diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-06-20 13:48:57 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-06-20 20:49:50 +0000 |
commit | 1600a7d9f8d5ec51336b3dbd83850756565eb6ca (patch) | |
tree | 1eb1952029762767ae693561eafa4abc05251446 /epan/dissectors/packet-icmp.c | |
parent | 50c19001412852c69fa89dc37499994ff6aaf009 (diff) |
Check the address type, not the address length, in multicast/broadcast tests.
The tests assume an IPv4 address; check for IPv4 addresses. They're
always 4 octets long, so no need to check the length.
Change the XXX comment to ask whether the check for an IPv4 address is
even necessary.
Change-Id: Ic55d2c208d5472ec995aa0c150b09a2118f04a76
Reviewed-on: https://code.wireshark.org/review/28353
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-icmp.c')
-rw-r--r-- | epan/dissectors/packet-icmp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index b8371a4b54..43f3fa3a5d 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -359,13 +359,13 @@ static const value_string interface_role_str[] = { #define is_a_broadcast_addr(a) ((a) == 0xffffffffU) /* - * XXX - should these be checking the address *type*, instead? + * XXX - will the destination address ever not be an IPv4 address? */ #define ADDR_IS_MULTICAST(addr) \ - (((addr)->len == 4) && is_a_multicast_addr(pntoh32((addr)->data))) + (((addr)->type == AT_IPv4) && is_a_multicast_addr(pntoh32((addr)->data))) #define ADDR_IS_BROADCAST(addr) \ - (((addr)->len == 4) && is_a_broadcast_addr(pntoh32((addr)->data))) + (((addr)->type == AT_IPv4) && is_a_broadcast_addr(pntoh32((addr)->data))) #define ADDR_IS_NOT_UNICAST(addr) \ (ADDR_IS_MULTICAST(addr) || ADDR_IS_BROADCAST(addr)) |