mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-27 12:03:44 +08:00
ICMPv6: Fix printing the Home Agent Address Discovery Reply Message
This change avoids incorrect truncation printing (" [|icmp6]") avoiding any attempt to get an IPv6 address past the end of the packet data. It also avoids a pointer overflow with a 32-bit build that stopped IPv6 addresses printing. (When length is big, e.g. Jumbo Payload).
This commit is contained in:
parent
f9ea99305f
commit
66dc8d7b96
@ -1253,7 +1253,8 @@ icmp6_print(netdissect_options *ndo,
|
||||
|
||||
ND_PRINT(", id 0x%04x",
|
||||
GET_BE_U_2(dp->icmp6_data16[0]));
|
||||
cp = (const u_char *)dp + length;
|
||||
cp = (const u_char *)dp +
|
||||
ND_MIN(length, ND_BYTES_AVAILABLE_AFTER(dp));
|
||||
p = (const u_char *)(dp + 1);
|
||||
while (p < cp) {
|
||||
ND_PRINT(", %s", GET_IP6ADDR_STRING(p));
|
||||
|
Loading…
Reference in New Issue
Block a user