Re: IP cheksum and libnet_pblock_coalesce
Kenichi MORI <[email protected]> Thu, 23 Sep 2004 17:00:04 -0700
| Newsgroups | gmane.comp.security.libnet |
|---|---|
| Message-ID | <[email protected]> |
Hi jarppe > Hello everybody, > > Should libnet_pblock_coalesce() set the IP checksum correctly? I'm using libnet 1.1.2.1, compiled with GCC 3.2.2 20030222 on Linux. > > When I create packet using libnet_build_[udp|tcp]() + libnet_build_ip(), then get the packet using libnet_pblock_coalesce() and then call libnet_ip_check() over the returned buffer, I get non-zero reply, indicating wrong IP checksum. > > Interestingly enough, if I create the packet with libnet_build_icmpv4_echo() + libnet_build_ip(), then libnet_ip_check() returns zero (checksum ok). > > Am I doing something wrong, or is there a bug? > > -jarppe I had something similar situation. I'm also using libnet 1.1.2.1 with GCC (Redhat9). I also found some wrong checksum packets created by libnet. So, I replace the function libnet_in_checksum() (libnet_checksum.c) with the same name function of libnet-1.0.2a, there is no wrong packet. -Kenichi