]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ipfc.c
DNS: Sync types with IANA
[tcpdump] / print-ipfc.c
index 7add1b7b0965cbdc358fd8d274dcdef19ea4d11d..ab5a81312f68832584634c225c3304bcae859e6f 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <string.h>
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "addrtoname.h"
 
@@ -95,12 +96,10 @@ ipfc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
        int llc_hdrlen;
 
        ndo->ndo_protocol = "ipfc";
-       if (caplen < IPFC_HDRLEN)
-               goto trunc;
+       ND_TCHECK_LEN(p, IPFC_HDRLEN);
        /*
         * Get the network addresses into a canonical form
         */
-       ND_TCHECK_SIZE(ipfcp);
        extract_ipfc_addrs(ipfcp, (char *)srcmac, (char *)dstmac);
 
        if (ndo->ndo_eflag)
@@ -128,9 +127,6 @@ ipfc_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
                llc_hdrlen = -llc_hdrlen;
        }
        return (IPFC_HDRLEN + llc_hdrlen);
-trunc:
-       nd_print_trunc(ndo);
-       return caplen;
 }
 
 /*
@@ -139,9 +135,9 @@ trunc:
  * 'h->len' is the length of the packet off the wire, and 'h->caplen'
  * is the number of bytes actually captured.
  */
-u_int
+void
 ipfc_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
-       ndo->ndo_protocol = "ipfc_if";
-       return (ipfc_print(ndo, p, h->len, h->caplen));
+       ndo->ndo_protocol = "ipfc";
+       ndo->ndo_ll_hdr_len += ipfc_print(ndo, p, h->len, h->caplen);
 }