]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Correctly check for various values of the ICMP type field.
authorGuy Harris <[email protected]>
Fri, 20 Aug 2010 02:23:08 +0000 (19:23 -0700)
committerGuy Harris <[email protected]>
Fri, 20 Aug 2010 02:23:08 +0000 (19:23 -0700)
clang+llvm warnings pointed out some incorrect code - you can't, in C,
check for multiple values for a variable that way.

CREDITS
print-icmp6.c

diff --git a/CREDITS b/CREDITS
index 50eec04e85dc1f4fce2df468056530e1a2f8a650..9e345d5a5f646b82a6ee2aeb5208fcb9aa51e235 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -148,6 +148,7 @@ Additional people who have contributed patches:
        Peter Jeremy                    <peter dot jeremy at alcatel dot com dot au>
                                        <pfhunt at users dot sourceforge dot net>
        Peter Volkov                    <pva at gentoo dot org>
+                                       <pwo at users dot sourceforge dot net>
        Phil Wood                       <cpw at lanl dot gov>
        Rafal Maszkowski                <rzm at icm dot edu dot pl>
        Randy Sofia                     <rsofia at users dot sourceforge dot net>
index cc486150e32cefea5253f6f68a5f0fa89c9ed1a1..24765381b654c5a611fb1f69834f102547e8ca41 100644 (file)
@@ -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) {