From: Guy Harris Date: Sat, 29 May 2010 01:19:36 +0000 (-0700) Subject: Handle the reserved value for the addressing modes. X-Git-Tag: tcpdump-4.2.1~104 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/f5f7f4a343bb54cee09ac707f59dd24eb24f89fd?ds=inline Handle the reserved value for the addressing modes. Report an error if the source or destination addressing mode has the reserved value. Also, squelch a warning. --- diff --git a/print-802_15_4.c b/print-802_15_4.c index ca7c9dbf..2016552c 100644 --- a/print-802_15_4.c +++ b/print-802_15_4.c @@ -124,12 +124,15 @@ ieee802_15_4_if_print(struct netdissect_options *ndo, p+= hdrlen; caplen -= hdrlen; } else { - u_int16_t panid; + u_int16_t panid = 0; switch ((fc >> 10) & 0x3) { case 0x00: ND_PRINT((ndo,"none ")); break; + case 0x01: + ND_PRINT((ndo,"reserved destination addressing mode")); + return 0; case 0x02: panid = EXTRACT_LE_16BITS(p); p += 2; @@ -149,6 +152,9 @@ ieee802_15_4_if_print(struct netdissect_options *ndo, case 0x00: ND_PRINT((ndo,"none ")); break; + case 0x01: + ND_PRINT((ndo,"reserved source addressing mode")); + return 0; case 0x02: if (!(fc & (1 << 6))) { panid = EXTRACT_LE_16BITS(p);