From bc55d41b9a5c062c0b0b7ee9b8642369d88d614b Mon Sep 17 00:00:00 2001 From: david Date: Thu, 2 Dec 2010 22:46:56 +0000 Subject: [PATCH] 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. --- tcpip.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcpip.cc b/tcpip.cc index fae33915a..713db0ae9 100644 --- a/tcpip.cc +++ b/tcpip.cc @@ -635,7 +635,8 @@ u8 *build_icmp_raw(const struct in_addr *source, 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.seq = htons(seq); pingpkt.checksum = 0;