]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ap1394.c
gre: add support for MikroTik Ethernet-over-IP hack.
[tcpdump] / print-ap1394.c
index 8e6454dd0ee38f18963d93056c0544ad917a83ce..b1988f270650e0126c93de5e0e822c538053fb5e 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "netdissect-stdinc.h"
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "extract.h"
 #include "addrtoname.h"
@@ -95,11 +96,7 @@ ap1394_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch
        struct lladdr_info src, dst;
 
        ndo->ndo_protocol = "ap1394";
-       if (caplen < FIREWIRE_HDRLEN) {
-               ndo->ndo_ll_hdr_len += caplen;
-               nd_print_trunc(ndo);
-               return;
-       }
+       ND_TCHECK_LEN(p, FIREWIRE_HDRLEN);
        ndo->ndo_ll_hdr_len += FIREWIRE_HDRLEN;
 
        if (ndo->ndo_eflag)
@@ -123,6 +120,4 @@ ap1394_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch
                if (!ndo->ndo_suppress_default_print)
                        ND_DEFAULTPRINT(p, caplen);
        }
-
-       return;
 }