]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-loopback.c
tcpdump.c: Fix a warning when HAVE_FORK and HAVE_VFORK are not defined
[tcpdump] / print-loopback.c
index e9d0b1a298a71748b11d7722baa5926d5b4e6cd0..e545eb07613b88a537dc62f36335315ae504b879 100644 (file)
 
 /*
  * originally defined as the Ethernet Configuration Testing Protocol.
- * specification: https://www.mit.edu/people/jhawk/ctp.pdf
+ * specification:
+ * https://web.archive.org/web/20060919181108/http://www.mit.edu/people/jhawk/ctp.pdf
  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "extract.h"
 #include "addrtoname.h"
@@ -79,12 +79,12 @@ loopback_message_print(netdissect_options *ndo,
                        ND_TCHECK_LEN(cp, len);
                        break;
                case LOOPBACK_FWDDATA:
-                       if (len < MAC_ADDR_LEN)
+                       if (len < MAC48_LEN)
                                goto invalid;
                        /* forwarding address */
-                       ND_PRINT(", forwarding address %s", GET_ETHERADDR_STRING(cp));
-                       cp += MAC_ADDR_LEN;
-                       len -= MAC_ADDR_LEN;
+                       ND_PRINT(", forwarding address %s", GET_MAC48_STRING(cp));
+                       cp += MAC48_LEN;
+                       len -= MAC48_LEN;
                        /* data */
                        ND_PRINT(", data (%u octets)", len);
                        ND_TCHECK_LEN(cp, len);
@@ -98,9 +98,6 @@ loopback_message_print(netdissect_options *ndo,
 invalid:
        nd_print_invalid(ndo);
        ND_TCHECK_LEN(cp, len);
-       return;
-trunc:
-       nd_trunc(ndo);
 }
 
 void
@@ -133,8 +130,5 @@ loopback_print(netdissect_options *ndo,
 invalid:
        nd_print_invalid(ndo);
        ND_TCHECK_LEN(cp, len);
-       return;
-trunc:
-       nd_trunc(ndo);
 }