]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Update more link-layer dissectors to void functions
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 12 Jul 2020 20:27:33 +0000 (22:27 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 15 Jul 2020 07:18:35 +0000 (09:18 +0200)
brcm_tag_if_print()
brcm_tag_prepend_if_print()
dsa_if_print()
edsa_if_print()
ether_if_print()
netanalyzer_if_print()
netanalyzer_transparent_if_print()

Update ether_print(), ether_common_print() and ether_switch_tag_print()
to void functions.

Add a flag parameter to ether_print(), ether_common_print() and
ether_switch_tag_print() to increment the link-layer header length field
of the netdissect_options when needed.
The calls use TRUE when the return value of the funtions was used.
The calls with FALSE avoid increments when the calls are nested.

Moreover:
Remove trailing "_if" from some protocol names.

16 files changed:
netdissect.h
print-bcm-li.c
print-brcmtag.c
print-dsa.c
print-ether.c
print-geneve.c
print-gre.c
print-juniper.c
print-lane.c
print-llc.c
print-nsh.c
print-openflow-1.0.c
print-otv.c
print-vxlan-gpe.c
print-vxlan.c
print.c

index f2e4570073d9df0b228f67b5ef05fff561446281..5a94a747d8e584171cd02c7a4045877f2015c1b8 100644 (file)
@@ -468,14 +468,14 @@ extern void arcnet_if_print IF_PRINTER_ARGS;
 extern void arcnet_linux_if_print IF_PRINTER_ARGS;
 extern u_int atm_if_print IF_PRINTER_ARGS;
 extern void bt_if_print IF_PRINTER_ARGS;
-extern u_int brcm_tag_if_print IF_PRINTER_ARGS;
-extern u_int brcm_tag_prepend_if_print IF_PRINTER_ARGS;
+extern void brcm_tag_if_print IF_PRINTER_ARGS;
+extern void brcm_tag_prepend_if_print IF_PRINTER_ARGS;
 extern u_int chdlc_if_print IF_PRINTER_ARGS;
 extern u_int cip_if_print IF_PRINTER_ARGS;
-extern u_int dsa_if_print IF_PRINTER_ARGS;
-extern u_int edsa_if_print IF_PRINTER_ARGS;
+extern void dsa_if_print IF_PRINTER_ARGS;
+extern void edsa_if_print IF_PRINTER_ARGS;
 extern void enc_if_print IF_PRINTER_ARGS;
-extern u_int ether_if_print IF_PRINTER_ARGS;
+extern void ether_if_print IF_PRINTER_ARGS;
 extern u_int fddi_if_print IF_PRINTER_ARGS;
 extern u_int fr_if_print IF_PRINTER_ARGS;
 extern u_int ieee802_11_if_print IF_PRINTER_ARGS;
@@ -504,8 +504,8 @@ extern u_int juniper_services_if_print IF_PRINTER_ARGS;
 extern u_int lane_if_print IF_PRINTER_ARGS;
 extern u_int ltalk_if_print IF_PRINTER_ARGS;
 extern u_int mfr_if_print IF_PRINTER_ARGS;
-extern u_int netanalyzer_if_print IF_PRINTER_ARGS;
-extern u_int netanalyzer_transparent_if_print IF_PRINTER_ARGS;
+extern void netanalyzer_if_print IF_PRINTER_ARGS;
+extern void netanalyzer_transparent_if_print IF_PRINTER_ARGS;
 extern void nflog_if_print IF_PRINTER_ARGS;
 extern void null_if_print IF_PRINTER_ARGS;
 extern u_int pflog_if_print IF_PRINTER_ARGS;
@@ -580,8 +580,8 @@ extern void eap_print(netdissect_options *, const u_char *, u_int);
 extern void egp_print(netdissect_options *, const u_char *, u_int);
 extern void eigrp_print(netdissect_options *, const u_char *, u_int);
 extern void esp_print(netdissect_options *, const u_char *, u_int, const u_char *, u_int, int, u_int);
-extern u_int ether_print(netdissect_options *, const u_char *, u_int, u_int, void (*)(netdissect_options *, const u_char *), const u_char *);
-extern u_int ether_switch_tag_print(netdissect_options *, const u_char *, u_int, u_int, void (*)(netdissect_options *, const u_char *), u_int);
+extern void ether_print(netdissect_options *, const u_char *, u_int, u_int, void (*)(netdissect_options *, const u_char *), const u_char *, u_int);
+extern void ether_switch_tag_print(netdissect_options *, const u_char *, u_int, u_int, void (*)(netdissect_options *, const u_char *), u_int, u_int);
 extern int ethertype_print(netdissect_options *, u_short, const u_char *, u_int, u_int, const struct lladdr_info *, const struct lladdr_info *);
 extern u_int fddi_print(netdissect_options *, const u_char *, u_int, u_int);
 extern void forces_print(netdissect_options *, const u_char *, u_int);
index 0233c3cb8a4b15cb52a6abfb58eef8c0a1e5852d..32214127a0e642f0171753d15f33fadce4846828 100644 (file)
@@ -95,7 +95,7 @@ bcm_li_print(netdissect_options *ndo, const u_char *p, u_int length)
 
        switch (pkt_type) {
        case BCM_LI_PKT_TYPE_ETHERNET:
-           ether_print(ndo, bp, length, length, NULL, NULL);
+           ether_print(ndo, bp, length, length, NULL, NULL, FALSE);
            break;
        case BCM_LI_PKT_TYPE_IPV4:
            ip_print(ndo, bp, length);
index da8b8a52c47b2c3a2b6e390699e1872e69b54982..61521365390f5d3564ee5d76ddc3cf62bbace488 100644 (file)
@@ -110,7 +110,7 @@ brcm_tag_print(netdissect_options *ndo, const u_char *bp)
        ND_PRINT(", ");
 }
 
-u_int
+void
 brcm_tag_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
                  const u_char *p)
 {
@@ -118,11 +118,12 @@ brcm_tag_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
        u_int length = h->len;
 
        ndo->ndo_protocol = "brcm-tag";
-       return (ether_switch_tag_print(ndo, p, length, caplen,
-           brcm_tag_print, BRCM_TAG_LEN));
+       ndo->ndo_ll_hdr_len += 0;
+       ether_switch_tag_print(ndo, p, length, caplen,
+                              brcm_tag_print, BRCM_TAG_LEN, TRUE);
 }
 
-u_int
+void
 brcm_tag_prepend_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
                          const u_char *p)
 {
@@ -131,8 +132,9 @@ brcm_tag_prepend_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
 
        ndo->ndo_protocol = "brcm-tag-prepend";
        if (caplen < BRCM_TAG_LEN) {
+               ndo->ndo_ll_hdr_len += caplen;
                nd_print_trunc(ndo);
-               return (caplen);
+               return;
        }
 
        if (ndo->ndo_eflag) {
@@ -146,5 +148,5 @@ brcm_tag_prepend_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
        /*
         * Now print the Ethernet frame following it.
         */
-       return ether_print(ndo, p, length, caplen, NULL, NULL);
+       ether_print(ndo, p, length, caplen, NULL, NULL, TRUE);
 }
index 7dad9e2a4d8c5dd8e4248956e416de3715494509..aec58f48e2cdec96e0ae86484485438a96c4f1eb 100644 (file)
@@ -196,24 +196,24 @@ edsa_tag_print(netdissect_options *ndo, const u_char *bp)
        tag_common_print(ndo, p);
 }
 
-u_int
+void
 dsa_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
        u_int caplen = h->caplen;
        u_int length = h->len;
 
        ndo->ndo_protocol = "dsa";
-       return (ether_switch_tag_print(ndo, p, length, caplen,
-           dsa_tag_print, DSA_LEN));
+       ndo->ndo_ll_hdr_len += 0;
+       ether_switch_tag_print(ndo, p, length, caplen, dsa_tag_print, DSA_LEN, TRUE);
 }
 
-u_int
+void
 edsa_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
        u_int caplen = h->caplen;
        u_int length = h->len;
 
        ndo->ndo_protocol = "edsa";
-       return (ether_switch_tag_print(ndo, p, length, caplen,
-           edsa_tag_print, EDSA_LEN));
+       ndo->ndo_ll_hdr_len += 0;
+       ether_switch_tag_print(ndo, p, length, caplen, edsa_tag_print, EDSA_LEN, TRUE);
 }
index 205cc8a7d7c99c0570d99e570981b763530df1a7..16b0fb7fecd0e2234de71edb9e669fddebdb6147 100644 (file)
@@ -133,13 +133,13 @@ ether_type_print(netdissect_options *ndo, uint16_t type)
  * switch chips, and extra encapsulation header information before
  * printing Ethernet header information (such as a LANE ID for ATM LANE).
  */
-static u_int
+static void
 ether_common_print(netdissect_options *ndo, const u_char *p, u_int length,
     u_int caplen,
     void (*print_switch_tag)(netdissect_options *ndo, const u_char *),
     u_int switch_tag_len,
     void (*print_encap_header)(netdissect_options *ndo, const u_char *),
-    const u_char *encap_header_arg)
+    const u_char *encap_header_arg, u_int do_incr_ll_hdr_len)
 {
        const struct ether_header *ehp;
        u_int orig_length;
@@ -151,11 +151,15 @@ ether_common_print(netdissect_options *ndo, const u_char *p, u_int length,
 
        if (caplen < ETHER_HDRLEN + switch_tag_len) {
                nd_print_trunc(ndo);
-               return (caplen);
+               if (do_incr_ll_hdr_len)
+                       ndo->ndo_ll_hdr_len += caplen;
+               return;
        }
        if (length < ETHER_HDRLEN + switch_tag_len) {
                nd_print_trunc(ndo);
-               return (length);
+               if (do_incr_ll_hdr_len)
+                       ndo->ndo_ll_hdr_len += length;
+               return;
        }
 
        if (print_encap_header != NULL)
@@ -226,10 +230,14 @@ recurse:
                        /* Payload is encrypted; print it as raw data. */
                        if (!ndo->ndo_suppress_default_print)
                                ND_DEFAULTPRINT(p, caplen);
-                       return (hdrlen);
+                       if (do_incr_ll_hdr_len)
+                               ndo->ndo_ll_hdr_len += hdrlen;
+                       return;
                } else if (ret > 0) {
                        /* Problem printing the header; just quit. */
-                       return (ret);
+                       if (do_incr_ll_hdr_len)
+                               ndo->ndo_ll_hdr_len += ret;
+                       return;
                } else {
                        /*
                         * Keep processing type/length fields.
@@ -258,12 +266,16 @@ recurse:
                if (caplen < 4) {
                        ndo->ndo_protocol = "vlan";
                        nd_print_trunc(ndo);
-                       return (hdrlen + caplen);
+                       if (do_incr_ll_hdr_len)
+                               ndo->ndo_ll_hdr_len += hdrlen + caplen;
+                       return;
                }
                if (length < 4) {
                        ndo->ndo_protocol = "vlan";
                        nd_print_trunc(ndo);
-                       return (hdrlen + length);
+                       if (do_incr_ll_hdr_len)
+                               ndo->ndo_ll_hdr_len += hdrlen + length;
+                       return;
                }
                if (ndo->ndo_eflag) {
                        uint16_t tag = GET_BE_U_2(p);
@@ -346,11 +358,15 @@ recurse:
        } else if (length_type == ETHERTYPE_ARISTA) {
                if (caplen < 2) {
                        ND_PRINT("[|arista]");
-                       return (hdrlen + caplen);
+                       if (do_incr_ll_hdr_len)
+                               ndo->ndo_ll_hdr_len += hdrlen + caplen;
+                       return;
                }
                if (length < 2) {
                        ND_PRINT("[|arista]");
-                       return (hdrlen + length);
+                       if (do_incr_ll_hdr_len)
+                               ndo->ndo_ll_hdr_len += hdrlen + length;
+                       return;
                }
                ether_type_print(ndo, length_type);
                ND_PRINT(", length %u: ", orig_length);
@@ -401,7 +417,9 @@ recurse:
                                ND_DEFAULTPRINT(p, caplen);
                }
        }
-       return (hdrlen);
+       if (do_incr_ll_hdr_len)
+               ndo->ndo_ll_hdr_len += hdrlen;
+       return;
 }
 
 /*
@@ -413,14 +431,14 @@ recurse:
  *
  * FIXME: caplen can and should be derived from ndo->ndo_snapend and p.
  */
-u_int
+void
 ether_switch_tag_print(netdissect_options *ndo, const u_char *p, u_int length,
     u_int caplen,
     void (*print_switch_tag)(netdissect_options *, const u_char *),
-    u_int switch_tag_len)
+    u_int switch_tag_len, u_int do_incr_ll_hdr_len)
 {
-       return (ether_common_print(ndo, p, length, caplen, print_switch_tag,
-                                  switch_tag_len, NULL, NULL));
+       ether_common_print(ndo, p, length, caplen, print_switch_tag,
+                          switch_tag_len, NULL, NULL, do_incr_ll_hdr_len);
 }
 
 /*
@@ -431,15 +449,15 @@ ether_switch_tag_print(netdissect_options *ndo, const u_char *p, u_int length,
  *
  * FIXME: caplen can and should be derived from ndo->ndo_snapend and p.
  */
-u_int
+void
 ether_print(netdissect_options *ndo,
            const u_char *p, u_int length, u_int caplen,
            void (*print_encap_header)(netdissect_options *ndo, const u_char *),
-           const u_char *encap_header_arg)
+           const u_char *encap_header_arg, u_int do_incr_ll_hdr_len)
 {
        ndo->ndo_protocol = "ether";
-       return (ether_common_print(ndo, p, length, caplen, NULL, 0,
-                                  print_encap_header, encap_header_arg));
+       ether_common_print(ndo, p, length, caplen, NULL, 0,
+                          print_encap_header, encap_header_arg, do_incr_ll_hdr_len);
 }
 
 /*
@@ -448,12 +466,14 @@ ether_print(netdissect_options *ndo,
  * of the packet off the wire, and 'h->caplen' is the number
  * of bytes actually captured.
  */
-u_int
+void
 ether_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
               const u_char *p)
 {
-       ndo->ndo_protocol = "ether_if";
-       return (ether_print(ndo, p, h->len, h->caplen, NULL, NULL));
+       ndo->ndo_protocol = "ether";
+       ndo->ndo_ll_hdr_len += 0;
+
+       ether_print(ndo, p, h->len, h->caplen, NULL, NULL, TRUE);
 }
 
 /*
@@ -465,21 +485,23 @@ ether_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
  * This is for DLT_NETANALYZER, which has a 4-byte pseudo-header
  * before the Ethernet header.
  */
-u_int
+void
 netanalyzer_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
                     const u_char *p)
 {
        /*
         * Fail if we don't have enough data for the Hilscher pseudo-header.
         */
-       ndo->ndo_protocol = "netanalyzer_if";
+       ndo->ndo_protocol = "netanalyzer";
        if (h->caplen < 4) {
+               ndo->ndo_ll_hdr_len += h->caplen;
                nd_print_trunc(ndo);
-               return (h->caplen);
+               return;
        }
+       ndo->ndo_ll_hdr_len += 4;
 
        /* Skip the pseudo-header. */
-       return (4 + ether_print(ndo, p + 4, h->len - 4, h->caplen - 4, NULL, NULL));
+       ether_print(ndo, p + 4, h->len - 4, h->caplen - 4, NULL, NULL, TRUE);
 }
 
 /*
@@ -492,7 +514,7 @@ netanalyzer_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
  * pseudo-header, a 7-byte Ethernet preamble, and a 1-byte Ethernet SOF
  * before the Ethernet header.
  */
-u_int
+void
 netanalyzer_transparent_if_print(netdissect_options *ndo,
                                 const struct pcap_pkthdr *h,
                                 const u_char *p)
@@ -501,14 +523,16 @@ netanalyzer_transparent_if_print(netdissect_options *ndo,
         * Fail if we don't have enough data for the Hilscher pseudo-header,
         * preamble, and SOF.
         */
-       ndo->ndo_protocol = "netanalyzer_transparent_if";
+       ndo->ndo_protocol = "netanalyzer_transparent";
        if (h->caplen < 12) {
+               ndo->ndo_ll_hdr_len += h->caplen;
                nd_print_trunc(ndo);
-               return (h->caplen);
+               return;
        }
+       ndo->ndo_ll_hdr_len += 12;
 
        /* Skip the pseudo-header, preamble, and SOF. */
-       return (12 + ether_print(ndo, p + 12, h->len - 12, h->caplen - 12, NULL, NULL));
+       ether_print(ndo, p + 12, h->len - 12, h->caplen - 12, NULL, NULL, TRUE);
 }
 
 /*
index 0b7ff6e514728fd92eaf2d5332106f7bfef428d3..d3e5e87ee9d184d63ba645036daccbdb080d2022 100644 (file)
@@ -232,7 +232,7 @@ geneve_print(netdissect_options *ndo, const u_char *bp, u_int len)
 
     if (ethertype_print(ndo, prot, bp, len, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL) == 0) {
         if (prot == ETHERTYPE_TEB)
-            ether_print(ndo, bp, len, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL);
+            ether_print(ndo, bp, len, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL, FALSE);
         else
             ND_PRINT("geneve-proto-0x%x", prot);
     }
index 09b2be113306267228a6fb5a5861c2e4b7714ec7..53c418fb7db4126adcaa067a7f2158f980b9e2b4 100644 (file)
@@ -224,7 +224,7 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length)
                isoclns_print(ndo, bp, len);
                break;
        case ETHERTYPE_TEB:
-               ether_print(ndo, bp, len, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL);
+               ether_print(ndo, bp, len, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL, FALSE);
                break;
        default:
                ND_PRINT("gre-proto-0x%x", prot);
index 91d5755b31239029309343530a0fd83fe4c497c7..0394fd89f1ef5f6633b64a92fb0b25d513194a62 100644 (file)
@@ -694,7 +694,7 @@ juniper_pppoe_if_print(netdissect_options *ndo,
 
         p+=l2info.header_len;
         /* this DLT contains nothing but raw ethernet frames */
-        ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL);
+        ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL, FALSE);
         return l2info.header_len;
 }
 #endif
@@ -713,7 +713,7 @@ juniper_ether_if_print(netdissect_options *ndo,
 
         p+=l2info.header_len;
         /* this DLT contains nothing but raw Ethernet frames */
-        ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL);
+        ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL, FALSE);
         return l2info.header_len;
 }
 #endif
@@ -1071,7 +1071,7 @@ juniper_atm2_if_print(netdissect_options *ndo,
         if (l2info.direction != JUNIPER_BPF_PKT_IN && /* ether-over-1483 encaps ? */
             /* use EXTRACT_, not GET_ (not packet buffer pointer) */
             (EXTRACT_BE_U_4(l2info.cookie) & ATM2_GAP_COUNT_MASK)) {
-            ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL);
+            ether_print(ndo, p, l2info.length, l2info.caplen, NULL, NULL, FALSE);
             return l2info.header_len;
         }
 
index a6f83b1a8572f57b2b436c0cc7c49de92f90ef62..d608ffde81c5c68ca5cc1a0394e36a179d1d87be 100644 (file)
@@ -113,7 +113,7 @@ lane_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
         * Now print the encapsulated frame, under the assumption
         * that it's an Ethernet frame.
         */
-       ether_print(ndo, p, length, caplen, lane_hdr_print, p - 2);
+       ether_print(ndo, p, length, caplen, lane_hdr_print, p - 2, FALSE);
 }
 
 u_int
index 750a8ccdae5499a4f2f5127922ae9b813dad90f4..c4422d9406a50e34e0ac843d8a818b7eff023846 100644 (file)
@@ -525,7 +525,7 @@ snap_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen,
                        /*
                         * What remains is an Ethernet packet.
                         */
-                       ether_print(ndo, p, length, caplen, NULL, NULL);
+                       ether_print(ndo, p, length, caplen, NULL, NULL, FALSE);
                        return (1);
 
                case PID_RFC2684_802_5_FCS:
index 17d6256925bd1e4b6a36071bc8de354eb733ab7c..70e962dfcae5821618bf7a925eeca81a48894d36 100644 (file)
@@ -170,7 +170,7 @@ nsh_print(netdissect_options *ndo, const u_char *bp, u_int len)
         ip6_print(ndo, bp, next_len);
         break;
     case 0x3:
-        ether_print(ndo, bp, next_len, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL);
+        ether_print(ndo, bp, next_len, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL, FALSE);
         break;
     default:
         ND_PRINT("ERROR: unknown-next-protocol");
index 71d8a7c1f215a3a508879b61cf31496120fe35ab..51ed38ef55a3eb1db0fa56e0a1aa11b5c6938ab6 100644 (file)
@@ -1128,7 +1128,7 @@ of10_packet_data_print(netdissect_options *ndo,
        ND_TCHECK_LEN(cp, len);
        ndo->ndo_vflag -= 3;
        ND_PRINT(", frame decoding below\n");
-       ether_print(ndo, cp, len, ND_BYTES_AVAILABLE_AFTER(cp), NULL, NULL);
+       ether_print(ndo, cp, len, ND_BYTES_AVAILABLE_AFTER(cp), NULL, NULL, FALSE);
        ndo->ndo_vflag += 3;
        return cp + len;
 
index dbcef9f676c28a8e003eeb2c5097b096f4d9ce33..f578d89ed604af81d86370e998906e1287328566 100644 (file)
@@ -67,7 +67,7 @@ otv_print(netdissect_options *ndo, const u_char *bp, u_int len)
     ND_TCHECK_1(bp);
     bp += 1;
 
-    ether_print(ndo, bp, len - OTV_HDR_LEN, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL);
+    ether_print(ndo, bp, len - OTV_HDR_LEN, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL, FALSE);
     return;
 
 trunc:
index d7a80f25dfdb83e64659320e41b35d6efae8fa8e..eb885824581e7d3b3f3d1b5872a01193c7aa6446 100644 (file)
@@ -92,7 +92,7 @@ vxlan_gpe_print(netdissect_options *ndo, const u_char *bp, u_int len)
         ip6_print(ndo, bp, len - VXLAN_GPE_HDR_LEN);
         break;
     case 0x3:
-        ether_print(ndo, bp, len - VXLAN_GPE_HDR_LEN, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL);
+        ether_print(ndo, bp, len - VXLAN_GPE_HDR_LEN, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL, FALSE);
         break;
     case 0x4:
         nsh_print(ndo, bp, len - VXLAN_GPE_HDR_LEN);
index d2b896b094503dcf9f215c75fd65965f83e55753..3d8c76c3c041278c790fd8fdf2abedfa7e03f5ee 100644 (file)
@@ -65,7 +65,7 @@ vxlan_print(netdissect_options *ndo, const u_char *bp, u_int len)
     ND_PRINT("flags [%s] (0x%02x), ", flags & 0x08 ? "I" : ".", flags);
     ND_PRINT("vni %u\n", vni);
 
-    ether_print(ndo, bp, len - VXLAN_HDR_LEN, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL);
+    ether_print(ndo, bp, len - VXLAN_HDR_LEN, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL, FALSE);
 
     return;
 
diff --git a/print.c b/print.c
index 9c4eef5542fb7f5e4d54c6707625b240410d59ee..dcecb1fffabe00cae587c6e059f46b0378475a9e 100644 (file)
--- a/print.c
+++ b/print.c
@@ -53,7 +53,6 @@ struct void_printer {
 };
 
 static const struct uint_printer uint_printers[] = {
-       { ether_if_print,       DLT_EN10MB },
 #ifdef DLT_IEEE802_15_4
        { ieee802_15_4_if_print, DLT_IEEE802_15_4 },
 #endif
@@ -63,12 +62,6 @@ static const struct uint_printer uint_printers[] = {
 #ifdef DLT_IEEE802_15_4_TAP
        { ieee802_15_4_tap_if_print, DLT_IEEE802_15_4_TAP },
 #endif
-#ifdef DLT_NETANALYZER
-       { netanalyzer_if_print, DLT_NETANALYZER },
-#endif
-#ifdef DLT_NETANALYZER_TRANSPARENT
-       { netanalyzer_transparent_if_print, DLT_NETANALYZER_TRANSPARENT },
-#endif
 #ifdef DLT_CIP
        { cip_if_print,         DLT_CIP },
 #endif
@@ -184,20 +177,8 @@ static const struct uint_printer uint_printers[] = {
 #ifdef DLT_PPP_SERIAL
        { ppp_hdlc_if_print,    DLT_PPP_SERIAL },
 #endif
-#ifdef DLT_DSA_TAG_BRCM
-       { brcm_tag_if_print,    DLT_DSA_TAG_BRCM },
-#endif
-#ifdef DLT_DSA_TAG_BRCM_PREPEND
-       { brcm_tag_prepend_if_print, DLT_DSA_TAG_BRCM_PREPEND },
-#endif
 #ifdef DLT_VSOCK
        { vsock_if_print,       DLT_VSOCK },
-#endif
-#ifdef DLT_DSA_TAG_DSA
-       { dsa_if_print, DLT_DSA_TAG_DSA },
-#endif
-#ifdef DLT_DSA_TAG_EDSA
-       { edsa_if_print,        DLT_DSA_TAG_EDSA },
 #endif
        { NULL,                 0 },
 };
@@ -210,15 +191,34 @@ static const struct void_printer void_printers[] = {
 #ifdef DLT_ARCNET_LINUX
        { arcnet_linux_if_print, DLT_ARCNET_LINUX },
 #endif
+#ifdef DLT_DSA_TAG_BRCM
+       { brcm_tag_if_print,    DLT_DSA_TAG_BRCM },
+#endif
+#ifdef DLT_DSA_TAG_BRCM_PREPEND
+       { brcm_tag_prepend_if_print, DLT_DSA_TAG_BRCM_PREPEND },
+#endif
 #ifdef DLT_BLUETOOTH_HCI_H4_WITH_PHDR
        { bt_if_print,          DLT_BLUETOOTH_HCI_H4_WITH_PHDR},
 #endif
+#ifdef DLT_DSA_TAG_DSA
+       { dsa_if_print,         DLT_DSA_TAG_DSA },
+#endif
+#ifdef DLT_DSA_TAG_EDSA
+       { edsa_if_print,        DLT_DSA_TAG_EDSA },
+#endif
 #ifdef DLT_ENC
        { enc_if_print,         DLT_ENC },
 #endif
+       { ether_if_print,       DLT_EN10MB },
 #ifdef DLT_IPNET
        { ipnet_if_print,       DLT_IPNET },
 #endif
+#ifdef DLT_NETANALYZER
+       { netanalyzer_if_print, DLT_NETANALYZER },
+#endif
+#ifdef DLT_NETANALYZER_TRANSPARENT
+       { netanalyzer_transparent_if_print, DLT_NETANALYZER_TRANSPARENT },
+#endif
 #ifdef DLT_NFLOG
        { nflog_if_print,       DLT_NFLOG},
 #endif