]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ether.c
Clean up printing of LLC packets.
[tcpdump] / print-ether.c
index e57d993b965e846ffc5670d470d198a08ce8e604..26c5c97c9c3005dddb83e6299e22c6e4329e603f 100644 (file)
@@ -19,7 +19,6 @@
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#define NETDISSECT_REWORKED
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -131,7 +130,6 @@ ether_print(netdissect_options *ndo,
        struct ether_header *ep;
        u_int orig_length;
        u_short ether_type;
        struct ether_header *ep;
        u_int orig_length;
        u_short ether_type;
-       u_short extracted_ether_type;
 
        if (caplen < ETHER_HDRLEN || length < ETHER_HDRLEN) {
                ND_PRINT((ndo, "[|ether]"));
 
        if (caplen < ETHER_HDRLEN || length < ETHER_HDRLEN) {
                ND_PRINT((ndo, "[|ether]"));
@@ -158,15 +156,8 @@ recurse:
         */
        if (ether_type <= ETHERMTU) {
                /* Try to print the LLC-layer header & higher layers */
         */
        if (ether_type <= ETHERMTU) {
                /* Try to print the LLC-layer header & higher layers */
-               if (llc_print(ndo, p, length, caplen, ESRC(ep), EDST(ep),
-                   &extracted_ether_type) == 0) {
+               if (llc_print(ndo, p, length, caplen, ESRC(ep), EDST(ep)) == 0) {
                        /* ether_type not known, print raw packet */
                        /* ether_type not known, print raw packet */
-                       if (!ndo->ndo_eflag) {
-                               if (print_encap_header != NULL)
-                                       (*print_encap_header)(ndo, encap_header_arg);
-                               ether_hdr_print(ndo, (u_char *)ep, orig_length);
-                       }
-
                        if (!ndo->ndo_suppress_default_print)
                                ND_DEFAULTPRINT(p, caplen);
                }
                        if (!ndo->ndo_suppress_default_print)
                                ND_DEFAULTPRINT(p, caplen);
                }
@@ -206,15 +197,8 @@ recurse:
                 * there's an LLC header and payload.
                 */
                /* Try to print the LLC-layer header & higher layers */
                 * there's an LLC header and payload.
                 */
                /* Try to print the LLC-layer header & higher layers */
-               if (llc_print(ndo, p, length, caplen, ESRC(ep), EDST(ep),
-                   &extracted_ether_type) == 0) {
+               if (llc_print(ndo, p, length, caplen, ESRC(ep), EDST(ep)) == 0) {
                        /* ether_type not known, print raw packet */
                        /* ether_type not known, print raw packet */
-                       if (!ndo->ndo_eflag) {
-                               if (print_encap_header != NULL)
-                                       (*print_encap_header)(ndo, encap_header_arg);
-                               ether_hdr_print(ndo, (u_char *)ep, orig_length);
-                       }
-
                        if (!ndo->ndo_suppress_default_print)
                                ND_DEFAULTPRINT(p, caplen);
                }
                        if (!ndo->ndo_suppress_default_print)
                                ND_DEFAULTPRINT(p, caplen);
                }