1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-26 17:39:03 +00:00

set the ip->ip_sum to 0 before computing the checksum of fragments. I'm not sure if this is necessary, but it is a useful sanity check at least.

This commit is contained in:
fyodor
2008-08-15 22:38:30 +00:00
parent 116ba8fb91
commit 8964cb8773

View File

@@ -1332,6 +1332,7 @@ int send_frag_ip_packet(int sd, struct eth_nfo *eth, u8 *packet,
if ((fragment-1) * mtu + fdatalen < datalen)
ip->ip_off |= htons(IP_MF);
#if HAVE_IP_IP_SUM
ip->ip_sum = 0;
ip->ip_sum = in_cksum((unsigned short *)ip, headerlen);
#endif
if (fragment > 1) // copy data payload