]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-802_11.c
Skip the LLC and SNAP headers with -x.
[tcpdump] / print-802_11.c
index 3c510e8a5a76992821fda9035f6a411f6e1a5831..2b4463ec07ac6fbf5bfde74a5af3d1792ed632e7 100644 (file)
@@ -2332,7 +2332,7 @@ ieee802_11_print(netdissect_options *ndo,
        uint16_t fc;
        u_int caplen, hdrlen, meshdrlen;
        const uint8_t *src, *dst;
-       u_short extracted_ethertype;
+       int llc_hdrlen;
 
        caplen = orig_caplen;
        /* Remove FCS, if present */
@@ -2409,23 +2409,17 @@ ieee802_11_print(netdissect_options *ndo,
                        }
                } else {
                        get_data_src_dst_mac(fc, p - hdrlen, &src, &dst);
-                       if (llc_print(ndo, p, length, caplen, dst, src,
-                           &extracted_ethertype) == 0) {
+                       llc_hdrlen = llc_print(ndo, p, length, caplen, dst, src);
+                       if (llc_hdrlen < 0) {
                                /*
                                 * Some kinds of LLC packet we cannot
                                 * handle intelligently
                                 */
-                               if (!ndo->ndo_eflag) {
-                                       ieee_802_11_hdr_print(ndo, fc, p - hdrlen,
-                                           hdrlen, meshdrlen);
-                               }
-                               if (extracted_ethertype)
-                                       ND_PRINT((ndo, "(LLC %s) ",
-                                           etherproto_string(
-                                               htons(extracted_ethertype))));
                                if (!ndo->ndo_suppress_default_print)
                                        ND_DEFAULTPRINT(p, caplen);
+                               llc_hdrlen = -llc_hdrlen;
                        }
+                       hdrlen += llc_hdrlen;
                }
                break;
        default: