]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Handle the reserved value for the addressing modes.
authorGuy Harris <[email protected]>
Sat, 29 May 2010 01:19:36 +0000 (18:19 -0700)
committerGuy Harris <[email protected]>
Sat, 29 May 2010 01:19:36 +0000 (18:19 -0700)
Report an error if the source or destination addressing mode has the
reserved value.  Also, squelch a warning.

print-802_15_4.c

index ca7c9dbf501865ba1867febc5621be82a4ceb5e3..2016552cea2ce27dfa44b8ab0db779b5f8355625 100644 (file)
@@ -124,12 +124,15 @@ ieee802_15_4_if_print(struct netdissect_options *ndo,
                p+= hdrlen;
                caplen -= hdrlen;
        } else {
                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;
 
                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;
                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 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);
                case 0x02:
                        if (!(fc & (1 << 6))) {
                                panid = EXTRACT_LE_16BITS(p);