From: Guy Harris Date: Fri, 20 Aug 2010 02:23:08 +0000 (-0700) Subject: Correctly check for various values of the ICMP type field. X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/2b4965f56167dfda7c60fc9db2d145698d948fd5 Correctly check for various values of the ICMP type field. clang+llvm warnings pointed out some incorrect code - you can't, in C, check for multiple values for a variable that way. --- diff --git a/CREDITS b/CREDITS index e456e251..2660a61e 100644 --- a/CREDITS +++ b/CREDITS @@ -146,6 +146,7 @@ Additional people who have contributed patches: Peter Jeremy Peter Volkov + Phil Wood Rafal Maszkowski Randy Sofia diff --git a/print-icmp6.c b/print-icmp6.c index cc486150..24765381 100644 --- a/print-icmp6.c +++ b/print-icmp6.c @@ -350,14 +350,13 @@ icmp6_print(netdissect_options *ndo, printf("ICMP6, %s", tok2str(icmp6_type_values,"unknown icmp6 type (%u)",dp->icmp6_type)); /* display cosmetics: print the packet length for printer that use the vflag now */ - if (vflag && (dp->icmp6_type == - ND_ROUTER_SOLICIT || - ND_ROUTER_ADVERT || - ND_NEIGHBOR_ADVERT || - ND_NEIGHBOR_SOLICIT || - ND_REDIRECT || - ICMP6_HADISCOV_REPLY || - ICMP6_MOBILEPREFIX_ADVERT )) + if (vflag && (dp->icmp6_type == ND_ROUTER_SOLICIT || + dp->icmp6_type == ND_ROUTER_ADVERT || + dp->icmp6_type == ND_NEIGHBOR_ADVERT || + dp->icmp6_type == ND_NEIGHBOR_SOLICIT || + dp->icmp6_type == ND_REDIRECT || + dp->icmp6_type == ICMP6_HADISCOV_REPLY || + dp->icmp6_type == ICMP6_MOBILEPREFIX_ADVERT )) printf(", length %u", length); switch (dp->icmp6_type) {