diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-08-02 11:24:45 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2020-08-02 11:24:45 +0200 |
commit | 006004fdda8721eeb86e191e4dd0cfc8a77d1e3d (patch) | |
tree | 8bc9e3bcc1fad35b30cbe9201e9e4d259022800c /print-802_15_4.c | |
parent | 627051ec20da08e6371673ca7b7d475af46c5630 (diff) | |
download | tcpdump-006004fdda8721eeb86e191e4dd0cfc8a77d1e3d.tar.gz |
IEEE 802.15.4: Update the link-layer dissectors to void functions
Diffstat (limited to 'print-802_15_4.c')
-rw-r--r-- | print-802_15_4.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/print-802_15_4.c b/print-802_15_4.c index cb0d76e8..c7d6c3f4 100644 --- a/print-802_15_4.c +++ b/print-802_15_4.c @@ -2492,18 +2492,18 @@ ieee802_15_4_print(netdissect_options *ndo, * Main function to print packets. */ -u_int +void ieee802_15_4_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; ndo->ndo_protocol = "802.15.4_if"; - return ieee802_15_4_print(ndo, p, caplen); + ndo->ndo_ll_hdr_len += ieee802_15_4_print(ndo, p, caplen); } /* For DLT_IEEE802_15_4_TAP */ /* https://github.com/jkcko/ieee802.15.4-tap */ -u_int +void ieee802_15_4_tap_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p) { @@ -2513,20 +2513,22 @@ ieee802_15_4_tap_if_print(netdissect_options *ndo, ndo->ndo_protocol = "802.15.4_tap"; if (h->caplen < 4) { nd_print_trunc(ndo); - return h->caplen; + ndo->ndo_ll_hdr_len += h->caplen; + return; } version = GET_U_1(p); length = GET_LE_U_2(p + 2); if (version != 0 || length < 4) { nd_print_invalid(ndo); - return 0; + return; } if (h->caplen < length) { nd_print_trunc(ndo); - return h->caplen; + ndo->ndo_ll_hdr_len += h->caplen; + return; } - return ieee802_15_4_print(ndo, p+length, h->caplen-length) + length; + ndo->ndo_ll_hdr_len += ieee802_15_4_print(ndo, p+length, h->caplen-length) + length; } |