recalculating tcp checksum after changing destination ip address??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I am pretty new to linux kernel development.

This is what I have been trying to do.

I am configuring the ethernet interface of my red hat 8 machine with 2.4.20 kernel as promiscuous and snooping on packets specific to destination lets say A.B.C.D. If I receive such a packet at the ethernet layer, then I do not discard it, but pass it up the protocol stack.

I wanted to check the checksum of this received packet and see if it is valid. I am able to verify that the ipHeader->cksum is valid(ip_fast_csum). One thing I would like to know, is which function in the TCP implementation should I call to verify the tcp checksum of the received packet.

Moreover, after that, I change the destination address of the packet from A.B.C.D to my machine's ip addr. I am able to recalcuate the ip_checksum and verify it as well. But I would also like to recalculate the tcp checksum. I see so many tcp_checksum functions that I am getting confused at this point of time, as to which one to use for this purpose.

I am sure a lot of people in this list would have tried something similar to this if not the same. Any help will be apprecialted.

Thanks,

-Vishwas.





I have a function(in the kernel, ip_rcv_finish... before the ip
> forwarding code.) that takes in packets, replaces the dest. ip:port, and
> sends to that machine. (ip forwarding is enabled.) I need to recalculate
> the checksum..... ip checksumming works fine(ip_fast_csum)... but, the tcp
> checksum is shown as incorrect on ethereal. The packets are not delivered
> to the new dest....
--
--
Vishwas Raman
Software Engineer, Eternal Systems, Inc,
5290 Overpass Rd, Bldg D, Santa Barbara. CA 93111
Email: vishwas@eternal-systems.com
Tel: (805) 696-9051 x246
Fax: (805) 696-9083
URL: http://www.eternal-systems.com/


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux