]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Process VLAN frames and Alteon jumbo frames in the Ethernet printer.
authorGuy Harris <[email protected]>
Sun, 21 Feb 2010 20:44:53 +0000 (12:44 -0800)
committerGuy Harris <[email protected]>
Sun, 21 Feb 2010 20:44:53 +0000 (12:44 -0800)
Instead of having the Ethernet-type handler process the VLAN and Alteon
jumbo frame Ethernet type values, process them in the Ethernet (and
Linux cooked-mode) dissectors.  This makes it easier for the right MAC
addresses to be printed for those packets.

As part of that, rename ether_encap_print() to ethertype_print() - it
doesn't print encapsulated Ethernet frames, it prints payloads whose
packet type is indicated by an Ethernet type field value - and remove
the no-longer-needed "extracted Ethernet type" argument.  That also lets
us eliminate it from the SNAP print routine.

Make ether_print() take a function, and an argument to pass to that
function, as parameters, so that, for example, the ATM LANE printer can
use it and put the LEC ID into the link-layer headeer printout.

interface.h
netdissect.h
print-ap1394.c
print-ether.c
print-fr.c
print-gre.c
print-juniper.c
print-lane.c
print-llc.c
print-sll.c
print-symantec.c

index 3638ddf71284f7775ab2e271405ac9078c1411fd..6e04b058c21c83579071d983f1cf7f376a6fc7ad 100644 (file)
@@ -166,10 +166,10 @@ extern void hex_and_ascii_print(const char *, const u_char *, u_int);
 extern void hex_print_with_offset(const char *, const u_char *, u_int, u_int);
 extern void hex_print(const char *, const u_char *, u_int);
 extern void telnet_print(const u_char *, u_int);
-extern int ether_encap_print(u_short, const u_char *, u_int, u_int, u_short *);
+extern int ethertype_print(u_short, const u_char *, u_int, u_int);
 extern int llc_print(const u_char *, u_int, u_int, const u_char *,
        const u_char *, u_short *);
-extern int snap_print(const u_char *, u_int, u_int, u_short *, u_int);
+extern int snap_print(const u_char *, u_int, u_int, u_int);
 extern void aarp_print(const u_char *, u_int);
 extern void aodv_print(const u_char *, u_int, int);
 extern void atalk_print(const u_char *, u_int);
@@ -189,7 +189,8 @@ extern u_int enc_if_print(const struct pcap_pkthdr *, const u_char *);
 extern u_int pflog_if_print(const struct pcap_pkthdr *, const u_char *);
 extern u_int arcnet_if_print(const struct pcap_pkthdr *, const u_char *);
 extern u_int arcnet_linux_if_print(const struct pcap_pkthdr *, const u_char *);
-extern void ether_print(const u_char *, u_int, u_int);
+extern void ether_print(const u_char *, u_int, u_int,
+    void (*)(const u_char *), const u_char *);
 extern u_int ether_if_print(const struct pcap_pkthdr *, const u_char *);
 extern u_int token_print(const u_char *, u_int, u_int);
 extern u_int token_if_print(const struct pcap_pkthdr *, const u_char *);
index f5c9211a0df95c6bf11a1d639df26c6d7aae2714..e87941daf180af4387241a6c4b1032a1f3e3c9ce 100644 (file)
@@ -291,8 +291,8 @@ extern void hex_print_with_offset(netdissect_options *,const char *,
                                  u_int, u_int);
 extern void hex_print(netdissect_options *,const char *, u_int);
 extern void telnet_print(netdissect_options *,const u_char *, u_int);
-extern int ether_encap_print(netdissect_options *,u_short, const u_char *,
-                            u_int, u_int, u_short *);
+extern int ethertype_print(netdissect_options *,u_short, const u_char *,
+                            u_int, u_int);
 extern int llc_print(netdissect_options *,
                     const u_char *, u_int, u_int, const u_char *,
                     const u_char *, u_short *);
index fe07a6739640c5a2da6a6d88da5c4a7538c4c17c..cb9d972f43b6f83a80db3e75f05e7b831db1b0d0 100644 (file)
@@ -91,7 +91,6 @@ ap1394_if_print(const struct pcap_pkthdr *h, const u_char *p)
        u_int caplen = h->caplen;
        struct firewire_header *fp;
        u_short ether_type;
-       u_short extracted_ether_type;
 
        if (caplen < FIREWIRE_HDRLEN) {
                printf("[|ap1394]");
@@ -107,10 +106,7 @@ ap1394_if_print(const struct pcap_pkthdr *h, const u_char *p)
        p += FIREWIRE_HDRLEN;
 
        ether_type = EXTRACT_16BITS(&fp->firewire_type);
-
-       extracted_ether_type = 0;
-       if (ether_encap_print(ether_type, p, length, caplen,
-           &extracted_ether_type) == 0) {
+       if (ethertype_print(ether_type, p, length, caplen) == 0) {
                /* ether_type not known, print raw packet */
                if (!eflag)
                        ap1394_hdr_print((u_char *)fp, length + FIREWIRE_HDRLEN);
index 581d688207e8e47162ea550ad05af6067805553f..e086d1660c090c8b2dd160051e0d996067ec3903 100644 (file)
@@ -113,20 +113,32 @@ ether_hdr_print(register const u_char *bp, u_int length)
        (void)printf(", length %u: ", length);
 }
 
+/*
+ * Print an Ethernet frame.
+ * This might be encapsulated within another frame; we might be passed
+ * a pointer to a function that can print header information for that
+ * frame's protocol, and an argument to pass to that function.
+ */
 void
-ether_print(const u_char *p, u_int length, u_int caplen)
+ether_print(const u_char *p, u_int length, u_int caplen,
+    void (*print_encap_header)(const u_char *), const u_char *encap_header_arg)
 {
        struct ether_header *ep;
+       u_int orig_length;
        u_short ether_type;
        u_short extracted_ether_type;
 
-       if (caplen < ETHER_HDRLEN) {
+       if (caplen < ETHER_HDRLEN || length < ETHER_HDRLEN) {
                printf("[|ether]");
                return;
        }
 
-       if (eflag)
+       if (eflag) {
+               if (print_encap_header != NULL)
+                       (*print_encap_header)(encap_header_arg);
                ether_hdr_print(p, length);
+       }
+       orig_length = length;
 
        length -= ETHER_HDRLEN;
        caplen -= ETHER_HDRLEN;
@@ -135,6 +147,7 @@ ether_print(const u_char *p, u_int length, u_int caplen)
 
        ether_type = EXTRACT_16BITS(&ep->ether_type);
 
+recurse:
        /*
         * Is it (gag) an 802.3 encapsulation?
         */
@@ -143,21 +156,76 @@ ether_print(const u_char *p, u_int length, u_int caplen)
                if (llc_print(p, length, caplen, ESRC(ep), EDST(ep),
                    &extracted_ether_type) == 0) {
                        /* ether_type not known, print raw packet */
-                       if (!eflag)
-                               ether_hdr_print((u_char *)ep, length + ETHER_HDRLEN);
+                       if (!eflag) {
+                               if (print_encap_header != NULL)
+                                       (*print_encap_header)(encap_header_arg);
+                               ether_hdr_print((u_char *)ep, orig_length);
+                       }
+
+                       if (!suppress_default_print)
+                               default_print(p, caplen);
+               }
+       } else if (ether_type == ETHERTYPE_8021Q) {
+               /*
+                * Print VLAN information, and then go back and process
+                * the enclosed type field.
+                */
+               if (caplen < 4 || length < 4) {
+                       printf("[|vlan]");
+                       return;
+               }
+               if (eflag) {
+                       u_int16_t tag = EXTRACT_16BITS(p);
+
+                       printf("vlan %u, p %u%s, ",
+                           tag & 0xfff,
+                           tag >> 13,
+                           (tag & 0x1000) ? ", CFI" : "");
+               }
+
+               ether_type = EXTRACT_16BITS(p + 2);
+               if (eflag && ether_type > ETHERMTU)
+                       printf("ethertype %s, ", tok2str(ethertype_values,"0x%04x", ether_type));
+               p += 4;
+               length -= 4;
+               caplen -= 4;
+               goto recurse;
+       } else if (ether_type == ETHERTYPE_JUMBO) {
+               /*
+                * Alteon jumbo frames.
+                * See
+                *
+                *      http://tools.ietf.org/html/draft-ietf-isis-ext-eth-01
+                *
+                * which indicates that, following the type field,
+                * there's an LLC header and payload.
+                */
+               /* Try to print the LLC-layer header & higher layers */
+               if (llc_print(p, length, caplen, ESRC(ep), EDST(ep),
+                   &extracted_ether_type) == 0) {
+                       /* ether_type not known, print raw packet */
+                       if (!eflag) {
+                               if (print_encap_header != NULL)
+                                       (*print_encap_header)(encap_header_arg);
+                               ether_hdr_print((u_char *)ep, orig_length);
+                       }
+
+                       if (!suppress_default_print)
+                               default_print(p, caplen);
+               }
+       } else {
+               if (ethertype_print(ether_type, p, length, caplen) == 0) {
+                       /* ether_type not known, print raw packet */
+                       if (!eflag) {
+                               if (print_encap_header != NULL)
+                                       (*print_encap_header)(encap_header_arg);
+                               ether_hdr_print((u_char *)ep, orig_length);
+                       }
 
                        if (!suppress_default_print)
                                default_print(p, caplen);
                }
-       } else if (ether_encap_print(ether_type, p, length, caplen,
-           &extracted_ether_type) == 0) {
-               /* ether_type not known, print raw packet */
-               if (!eflag)
-                       ether_hdr_print((u_char *)ep, length + ETHER_HDRLEN);
-
-               if (!suppress_default_print)
-                       default_print(p, caplen);
-       } 
+       }
 }
 
 /*
@@ -169,30 +237,21 @@ ether_print(const u_char *p, u_int length, u_int caplen)
 u_int
 ether_if_print(const struct pcap_pkthdr *h, const u_char *p)
 {
-       ether_print(p, h->len, h->caplen);
+       ether_print(p, h->len, h->caplen, NULL, NULL);
 
        return (ETHER_HDRLEN);
 }
 
 /*
- * Prints the packet encapsulated in an Ethernet data segment
- * (or an equivalent encapsulation), given the Ethernet type code.
+ * Prints the packet payload, given an Ethernet type code for the payload's
+ * protocol.
  *
  * Returns non-zero if it can do so, zero if the ethertype is unknown.
- *
- * The Ethernet type code is passed through a pointer; if it was
- * ETHERTYPE_8021Q, it gets updated to be the Ethernet type of
- * the 802.1Q payload, for the benefit of lower layers that might
- * want to know what it is.
  */
 
 int
-ether_encap_print(u_short ether_type, const u_char *p,
-    u_int length, u_int caplen, u_short *extracted_ether_type)
+ethertype_print(u_short ether_type, const u_char *p, u_int length, u_int caplen)
 {
- recurse:
-       *extracted_ether_type = ether_type;
-
        switch (ether_type) {
 
        case ETHERTYPE_IP:
@@ -229,68 +288,6 @@ ether_encap_print(u_short ether_type, const u_char *p,
                ipx_print(p, length);
                return (1);
 
-       case ETHERTYPE_8021Q:
-               if (eflag) {
-                       u_int16_t tag = EXTRACT_16BITS(p);
-
-                       printf("vlan %u, p %u%s, ",
-                           tag & 0xfff,
-                           tag >> 13,
-                           (tag & 0x1000) ? ", CFI" : "");
-               }
-
-               ether_type = EXTRACT_16BITS(p + 2);
-               p += 4;
-               length -= 4;
-               caplen -= 4;
-
-               if (ether_type > ETHERMTU) {
-                       if (eflag)
-                               printf("ethertype %s, ",
-                                      tok2str(ethertype_values,"0x%04x", ether_type));
-                       goto recurse;
-               }
-
-               *extracted_ether_type = 0;
-
-               if (llc_print(p, length, caplen, p - 18, p - 12,
-                   extracted_ether_type) == 0) {
-                        ether_hdr_print(p - 18, length + 4);
-
-                        if (!suppress_default_print) {
-                                default_print(p - 18, caplen + 4);
-                        }
-               }
-
-
-               return (1);
-
-        case ETHERTYPE_JUMBO:
-                ether_type = EXTRACT_16BITS(p);
-                p += 2;
-                length -= 2;      
-                caplen -= 2;
-
-                if (ether_type > ETHERMTU) {
-                    if (eflag)
-                        printf("ethertype %s, ",
-                               tok2str(ethertype_values,"0x%04x", ether_type));
-                    goto recurse;
-                }
-
-                *extracted_ether_type = 0;
-
-                if (llc_print(p, length, caplen, p - 16, p - 10,
-                              extracted_ether_type) == 0) {
-                    ether_hdr_print(p - 16, length + 2);
-
-                    if (!suppress_default_print) {
-                            default_print(p - 16, caplen + 2);
-                    }
-                }
-
-                return (1);
-
         case ETHERTYPE_ISO:
                 isoclns_print(p+1, length-1, length-1);
                 return(1);
index f71aee665273494bbca4fd07dc356f2c72a97f09..8f1409e98592ac46fdabb734e3e92f750f7a1f58 100644 (file)
@@ -256,11 +256,10 @@ fr_print(register const u_char *p, u_int length)
                 if (eflag)
                     fr_hdr_print(length, addr_len, dlci, flags, extracted_ethertype);
 
-                if (ether_encap_print(extracted_ethertype,
+                if (ethertype_print(extracted_ethertype,
                                       p+addr_len+ETHERTYPE_LEN,
                                       length-addr_len-ETHERTYPE_LEN,
-                                      length-addr_len-ETHERTYPE_LEN,
-                                      &extracted_ethertype) == 0)
+                                      length-addr_len-ETHERTYPE_LEN) == 0)
                     /* ether_type not known, probably it wasn't one */
                     printf("UI %02x! ", p[addr_len]);
                 else
@@ -297,7 +296,7 @@ fr_print(register const u_char *p, u_int length)
                break;
 
        case NLPID_SNAP:
-               if (snap_print(p, length, length, &extracted_ethertype, 0) == 0) {
+               if (snap_print(p, length, length, 0) == 0) {
                        /* ether_type not known, print raw packet */
                         if (!eflag)
                             fr_hdr_print(length + hdr_len, hdr_len,
index 8473848d373b3f0aba4fdfbafce7a35874dce52a..106e6fd3111abd173fdd49418bbc18148047e821 100644 (file)
@@ -226,7 +226,7 @@ gre_print_0(const u_char *bp, u_int length)
                isoclns_print(bp, len, len);
                break;
        case ETHERTYPE_TEB:
-               ether_print(bp, len, len);
+               ether_print(bp, len, len, NULL, NULL);
                break;
        default:
                printf("gre-proto-0x%x", prot);
index 08a929f1e2690c7e50cf10e82b71c07ec001955c..55ca1c9c640522c4fc0b5519b495416c968cfdb8 100644 (file)
@@ -647,7 +647,7 @@ juniper_pppoe_print(const struct pcap_pkthdr *h, register const u_char *p)
 
         p+=l2info.header_len;
         /* this DLT contains nothing but raw ethernet frames */
-        ether_print(p, l2info.length, l2info.caplen);
+        ether_print(p, l2info.length, l2info.caplen, NULL, NULL);
         return l2info.header_len;
 }
 #endif
@@ -664,7 +664,7 @@ juniper_ether_print(const struct pcap_pkthdr *h, register const u_char *p)
 
         p+=l2info.header_len;
         /* this DLT contains nothing but raw Ethernet frames */
-        ether_print(p, l2info.length, l2info.caplen);
+        ether_print(p, l2info.length, l2info.caplen, NULL, NULL);
         return l2info.header_len;
 }
 #endif
@@ -736,11 +736,10 @@ juniper_pppoe_atm_print(const struct pcap_pkthdr *h, register const u_char *p)
         extracted_ethertype = EXTRACT_16BITS(p);
         /* this DLT contains nothing but raw PPPoE frames,
          * prepended with a type field*/
-        if (ether_encap_print(extracted_ethertype,
+        if (ethertype_print(extracted_ethertype,
                               p+ETHERTYPE_LEN,
                               l2info.length-ETHERTYPE_LEN,
-                              l2info.caplen-ETHERTYPE_LEN,
-                              &extracted_ethertype) == 0)
+                              l2info.caplen-ETHERTYPE_LEN) == 0)
             /* ether_type not known, probably it wasn't one */
             printf("unknown ethertype 0x%04x", extracted_ethertype);
         
@@ -988,7 +987,7 @@ juniper_atm2_print(const struct pcap_pkthdr *h, register const u_char *p)
 
         if (l2info.direction != JUNIPER_BPF_PKT_IN && /* ether-over-1483 encaps ? */
             (EXTRACT_32BITS(l2info.cookie) & ATM2_GAP_COUNT_MASK)) {
-            ether_print(p, l2info.length, l2info.caplen);
+            ether_print(p, l2info.length, l2info.caplen, NULL, NULL);
             return l2info.header_len;
         }
 
index 33723aaa4751c4953d394aa684682f7c5eebc723..54c68c82aa2b426b69432f63a61f8cae2c297d1f 100644 (file)
@@ -60,25 +60,10 @@ static const struct tok lecop2str[] = {
        { 0,            NULL }
 };
 
-static inline void
-lane_hdr_print(register const u_char *bp, int length)
+static void
+lane_hdr_print(const u_char *bp)
 {
-       register const struct lecdatahdr_8023 *ep;
-
-       ep = (const struct lecdatahdr_8023 *)bp;
-       if (qflag)
-               (void)printf("lecid:%x %s %s %d: ",
-                            EXTRACT_16BITS(&ep->le_header),
-                            etheraddr_string(ep->h_source),
-                            etheraddr_string(ep->h_dest),
-                            length);
-       else
-               (void)printf("lecid:%x %s %s %s %d: ",
-                            EXTRACT_16BITS(&ep->le_header),
-                            etheraddr_string(ep->h_source),
-                            etheraddr_string(ep->h_dest),
-                            etherproto_string(ep->h_type),
-                            length);
+       (void)printf("lecid:%x ", EXTRACT_16BITS(bp));
 }
 
 /*
@@ -93,9 +78,6 @@ void
 lane_print(const u_char *p, u_int length, u_int caplen)
 {
        struct lane_controlhdr *lec;
-       struct lecdatahdr_8023 *ep;
-       u_short ether_type;
-       u_short extracted_ethertype;
 
        if (caplen < sizeof(struct lane_controlhdr)) {
                printf("[|lane]");
@@ -113,49 +95,18 @@ lane_print(const u_char *p, u_int length, u_int caplen)
                return;
        }
 
-       if (caplen < sizeof(struct lecdatahdr_8023)) {
-               printf("[|lane]");
-               return;
-       }
-
-       if (eflag)
-               lane_hdr_print(p, length);
-
        /*
-        * Go past the LANE header.
+        * Go past the LE header.
         */
-       length -= sizeof(struct lecdatahdr_8023);
-       caplen -= sizeof(struct lecdatahdr_8023);
-       ep = (struct lecdatahdr_8023 *)p;
-       p += sizeof(struct lecdatahdr_8023);
-
-       ether_type = EXTRACT_16BITS(&ep->h_type);
+       length -= 2;
+       caplen -= 2;
+       p += 2;
 
        /*
-        * Is it (gag) an 802.3 encapsulation?
+        * Now print the encapsulated frame, under the assumption
+        * that it's an Ethernet frame.
         */
-       if (ether_type <= ETHERMTU) {
-               /* Try to print the LLC-layer header & higher layers */
-               if (llc_print(p, length, caplen, ep->h_source, ep->h_dest,
-                   &extracted_ethertype) == 0) {
-                       /* ether_type not known, print raw packet */
-                       if (!eflag)
-                               lane_hdr_print((u_char *)ep, length + sizeof(*ep));
-                       if (extracted_ethertype) {
-                               printf("(LLC %s) ",
-                              etherproto_string(htons(extracted_ethertype)));
-                       }
-                       if (!suppress_default_print)
-                               default_print(p, caplen);
-               }
-       } else if (ether_encap_print(ether_type, p, length, caplen,
-           &extracted_ethertype) == 0) {
-               /* ether_type not known, print raw packet */
-               if (!eflag)
-                       lane_hdr_print((u_char *)ep, length + sizeof(*ep));
-               if (!suppress_default_print)
-                       default_print(p, caplen);
-       }
+       ether_print(p, length, caplen, lane_hdr_print, p - 2);
 }
 
 u_int
index 0c8259fbb6b8a3b38ba1405cf28c515e33de8119..d20fbdf13c36a151952bc66a0ab7fcaf225b2cb0 100644 (file)
@@ -309,8 +309,7 @@ llc_print(const u_char *p, u_int length, u_int caplen,
                 * Does anybody ever bridge one form of LAN traffic
                 * over a networking type that uses 802.2 LLC?
                 */
-               ret = snap_print(p+3, length-3, caplen-3, extracted_ethertype,
-                   2);
+               ret = snap_print(p+3, length-3, caplen-3, 2);
                if (ret)
                        return (ret);
        }
@@ -378,8 +377,7 @@ llc_print(const u_char *p, u_int length, u_int caplen,
 }
 
 int
-snap_print(const u_char *p, u_int length, u_int caplen,
-    u_short *extracted_ethertype, u_int bridge_pad)
+snap_print(const u_char *p, u_int length, u_int caplen, u_int bridge_pad)
 {
        u_int32_t orgcode;
        register u_short et;
@@ -419,8 +417,7 @@ snap_print(const u_char *p, u_int length, u_int caplen,
                 * Cisco hardware; the protocol ID is
                 * an Ethernet protocol type.
                 */
-               ret = ether_encap_print(et, p, length, caplen,
-                   extracted_ethertype);
+               ret = ethertype_print(et, p, length, caplen);
                if (ret)
                        return (ret);
                break;
@@ -435,8 +432,7 @@ snap_print(const u_char *p, u_int length, u_int caplen,
                         * but used 0x000000 and an Ethernet
                         * packet type for AARP packets.
                         */
-                       ret = ether_encap_print(et, p, length, caplen,
-                           extracted_ethertype);
+                       ret = ethertype_print(et, p, length, caplen);
                        if (ret)
                                return (ret);
                }
@@ -483,7 +479,7 @@ snap_print(const u_char *p, u_int length, u_int caplen,
                        /*
                         * What remains is an Ethernet packet.
                         */
-                       ether_print(p, length, caplen);
+                       ether_print(p, length, caplen, NULL, NULL);
                        return (1);
 
                case PID_RFC2684_802_5_FCS:
index 8edf3b0efa50fa0dda25e04aed532ec6419b03da..c9546585dcb1c3992611a9abf42e36034da2b16c 100644 (file)
@@ -144,6 +144,7 @@ sll_if_print(const struct pcap_pkthdr *h, const u_char *p)
 
        ether_type = EXTRACT_16BITS(&sllp->sll_protocol);
 
+recurse:
        /*
         * Is it (gag) an 802.3 encapsulation, or some non-Ethernet
         * packet type?
@@ -187,13 +188,43 @@ sll_if_print(const struct pcap_pkthdr *h, const u_char *p)
                                default_print(p, caplen);
                        break;
                }
-       } else if (ether_encap_print(ether_type, p, length, caplen,
-           &extracted_ethertype) == 0) {
-               /* ether_type not known, print raw packet */
-               if (!eflag)
-                       sll_print(sllp, length + SLL_HDR_LEN);
-               if (!suppress_default_print)
-                       default_print(p, caplen);
+       } else if (ether_type == ETHERTYPE_8021Q) {
+               /*
+                * Print VLAN information, and then go back and process
+                * the enclosed type field.
+                */
+               if (caplen < 4 || length < 4) {
+                       printf("[|vlan]");
+                       return (SLL_HDR_LEN);
+               }
+               if (eflag) {
+                       u_int16_t tag = EXTRACT_16BITS(p);
+
+                       printf("vlan %u, p %u%s, ",
+                           tag & 0xfff,
+                           tag >> 13,
+                           (tag & 0x1000) ? ", CFI" : "");
+               }
+
+               ether_type = EXTRACT_16BITS(p + 2);
+               if (ether_type <= ETHERMTU)
+                       ether_type = LINUX_SLL_P_802_2;
+               if (!qflag) {
+                       (void)printf("ethertype %s, ",
+                           tok2str(ethertype_values, "Unknown", ether_type));
+               }
+               p += 4;
+               length -= 4;
+               caplen -= 4;
+               goto recurse;
+       } else {
+               if (ethertype_print(ether_type, p, length, caplen) == 0) {
+                       /* ether_type not known, print raw packet */
+                       if (!eflag)
+                               sll_print(sllp, length + SLL_HDR_LEN);
+                       if (!suppress_default_print)
+                               default_print(p, caplen);
+               }
        }
 
        return (SLL_HDR_LEN);
index e212b1a436b10f64b21f9322cd47640fddf6bf1c..0fba8e534de4884bcdd800a2aba79e9decda6c09 100644 (file)
@@ -84,7 +84,6 @@ symantec_if_print(const struct pcap_pkthdr *h, const u_char *p)
        u_int caplen = h->caplen;
        struct symantec_header *sp;
        u_short ether_type;
-       u_short extracted_ether_type;
 
        if (caplen < sizeof (struct symantec_header)) {
                printf("[|symantec]");
@@ -108,8 +107,7 @@ symantec_if_print(const struct pcap_pkthdr *h, const u_char *p)
 
                if (!suppress_default_print)
                        default_print(p, caplen);
-       } else if (ether_encap_print(ether_type, p, length, caplen,
-           &extracted_ether_type) == 0) {
+       } else if (ethertype_print(ether_type, p, length, caplen) == 0) {
                /* ether_type not known, print raw packet */
                if (!eflag)
                        symantec_hdr_print((u_char *)sp, length + sizeof (struct symantec_header));