Re: a problem with tcp checksum
"Jee J.Z." <[email protected]> Mon, 31 May 2004 21:41:56 +0100
| Newsgroups | gmane.comp.security.libnet |
|---|---|
| Message-ID | <002701c4474f$b6943050$68892090@grouse> |
Hi Fred, I'm using Mandrake linux 9.2, libnet-1.1.2.1. I'm not sure whether it is the endianess problem you mentioned. I've done more experiments and found that not all TCP checksums with odd-size TCP payload are badly computed, while most of them are. Really strange. And sometimes the first TCP packet with odd-size payload and the following TCP packets with the same size payload or even-size payload work well, while once a TCP packet with a different odd size payload comes up, checksum goes wrong. Did anybody report the similar problem? Thank you. Jee > Hi, > > on what architecture and system are you using libnet? I fixed a > similar bug some times ago that caused that behavior: it was caused by > an endianess problem (bad casting). And what version of libnet are you > using ? > > Fred Raynal > > On Mon, May 31, 2004 at 08:44:09AM +0530, [email protected] wrote: > > > > > > > > > > Hi Jeez, > > > > This seems wierd, as i said I havent worked with tcp checksum in libnet > > yet, but my guess says that this might be your problem, whenever we > > calculate checksum for a TCP segment its mandatory that header+text length > > is even, if its odd just for checksum calculation purposes the last byte(on > > the right) is padded(all zeros). This byte is not transmitted as part of > > the segment though, maybe libnet doesnt do it itself, this is completely a > > guess cos I dont know how checksumming with libnet works. > > > > cheers > > Amit > > > > > > > > > > > > "Jee J.Z." <[email protected]> on 05/31/2004 05:18:02 AM > > > > To: <[email protected]> > > cc: > > > > Subject: a problem with tcp checksum > > > > > > Hi all, > > > > I am going frustrated since a wired problem with tcp checksum seem to > > always > > happen. ;-( I really wish to see somebody throw some light on it. The > > situation is as follows: > > > > I am trying to inject TCP packets using libnet_build_tcp_options(), > > libnet_build_tcp() and libnet_build_ipv4() (checksum automatically built). > > When TCP payload size is odd in byte, the tcp checksum is always incorrect > > (using ethereal to capture injected packets and check them); while if TCP > > payload size is even in byte, everything seems working very well. > > > > What I wish to know is do I need to manually change some parameters of > > libnet_build_tcp_options(), libnet_build_tcp() or libnet_build_ipv4() when > > the tcp payload size is odd in byte, in order to let libnet compute tcp > > checksum correctly? If not, what shall I do to fix the problem? I am > > looking > > forward to your help. Thank you very much in advance! > > > > Regards, > > Jee > > > > > > > > >