]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bt.c
CI: Add warning exemptions for Sun C (suncc-5.15) on Solaris 10
[tcpdump] / print-bt.c
index d65a5ff820037b06de4af699f30371c809b86a2c..290434b99cc0ab9a7e265459f9281bf245312aef 100644 (file)
 
 /* \summary: Bluetooth printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "extract.h"
 
@@ -51,16 +50,12 @@ bt_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *
 {
        u_int length = h->len;
        u_int caplen = h->caplen;
-       const bluetooth_h4_header* hdr = (const bluetooth_h4_header*)p;
+       const bluetooth_h4_header *hdr = (const bluetooth_h4_header *)p;
 
        ndo->ndo_protocol = "bluetooth";
        nd_print_protocol(ndo);
-       if (caplen < BT_HDRLEN) {
-               ndo->ndo_ll_header_length += caplen;
-               nd_print_trunc(ndo);
-               return;
-       }
-       ndo->ndo_ll_header_length += BT_HDRLEN;
+       ND_TCHECK_LEN(p, BT_HDRLEN);
+       ndo->ndo_ll_hdr_len += BT_HDRLEN;
        caplen -= BT_HDRLEN;
        length -= BT_HDRLEN;
        p += BT_HDRLEN;
@@ -70,6 +65,5 @@ bt_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *
 
        if (!ndo->ndo_suppress_default_print)
                ND_DEFAULTPRINT(p, caplen);
-       return;
 }
 #endif