mirror of
https://github.com/nmap/nmap.git
synced 2025-12-22 15:39:03 +00:00
Add a comment explaining why we can unconditionally set the id and seq
fields in build_icmp_raw, even though not all ICMP types have them. All the types handled by the function do have them, and in the same place.
This commit is contained in:
3
tcpip.cc
3
tcpip.cc
@@ -635,7 +635,8 @@ u8 *build_icmp_raw(const struct in_addr *source,
|
|||||||
memset(datastart, 0, MIN(dlen, datalen));
|
memset(datastart, 0, MIN(dlen, datalen));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill out the ping packet */
|
/* Fill out the ping packet. All the ICMP types handled by this function have
|
||||||
|
the id and seq fields. */
|
||||||
pingpkt.id = htons(id);
|
pingpkt.id = htons(id);
|
||||||
pingpkt.seq = htons(seq);
|
pingpkt.seq = htons(seq);
|
||||||
pingpkt.checksum = 0;
|
pingpkt.checksum = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user