]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-cdp.c
CHANGES: Add/move change(s) backported to 4.99
[tcpdump] / print-cdp.c
index 9f5c24bca6bd375aa3431ac287a46f282e85d61b..c4adf180c84bffe883394729018f0e6dbecf6871 100644 (file)
@@ -26,9 +26,7 @@
 
 /* \summary: Cisco Discovery Protocol (CDP) printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -309,7 +307,7 @@ cdp_print(netdissect_options *ndo,
                        }
                }
 
-               if (!covered) {
+               if (ndo->ndo_vflag && !covered) {
                        ND_TCHECK_LEN(tptr, len);
                        print_unknown_data(ndo, tptr, "\n\t  ", len);
                }
@@ -389,8 +387,7 @@ cdp_print_addr(netdissect_options *ndo,
                        ND_PRINT("IPv4 (%u) %s", num, GET_IPADDR_STRING(p));
                        p += al;
                        l -= al;
-               }
-               else if (pt == PT_IEEE_802_2 && pl == 8 &&
+               } else if (pt == PT_IEEE_802_2 && pl == 8 &&
                         memcmp(p, prot_ipv6, 8) == 0 && al == 16) {
                        /*
                         * IPv6: protocol type = IEEE 802.2 header,
@@ -408,8 +405,7 @@ cdp_print_addr(netdissect_options *ndo,
                        ND_PRINT("IPv6 (%u) %s", num, GET_IP6ADDR_STRING(p));
                        p += al;
                        l -= al;
-               }
-               else {
+               } else {
                        /*
                         * Generic case: just print raw data
                         */