X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/9d046ee0503d4c8cbfcb200c88986de876f6cae7..refs/heads/master:/print-bt.c diff --git a/print-bt.c b/print-bt.c index d65a5ff8..290434b9 100644 --- a/print-bt.c +++ b/print-bt.c @@ -19,12 +19,11 @@ /* \summary: Bluetooth printer */ -#ifdef HAVE_CONFIG_H #include -#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