Re: recalculating tcp checksum after changing destination ip address??

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

 



Please ignore the last part of my previous email...that was the result of a copy-paste :-)

The valid part of the previous email is pasted here again.

sorry abt that.

-Vishwas.


Vishwas Raman wrote:
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.




-- 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