]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ap1394.c
gre: add support for MikroTik Ethernet-over-IP hack.
[tcpdump] / print-ap1394.c
index 8cc22fe83215ee8b2ec69c804bb706d2b23b7295..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"
@@ -52,7 +53,7 @@ struct firewire_header {
 static const char *
 fwaddr_string(netdissect_options *ndo, const u_char *addr)
 {
-       return (linkaddr_string(ndo, addr, LINKADDR_IEEE1394, FIREWIRE_EUI64_LEN));
+       return GET_LINKADDR_STRING(addr, LINKADDR_IEEE1394, FIREWIRE_EUI64_LEN);
 }
 
 static void
@@ -95,12 +96,8 @@ 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_header_length += caplen;
-               nd_print_trunc(ndo);
-               return;
-       }
-       ndo->ndo_ll_header_length += FIREWIRE_HDRLEN;
+       ND_TCHECK_LEN(p, FIREWIRE_HDRLEN);
+       ndo->ndo_ll_hdr_len += FIREWIRE_HDRLEN;
 
        if (ndo->ndo_eflag)
                ap1394_hdr_print(ndo, p, length);
@@ -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;
 }