Skip to content

Commit f5f7f4a

Browse files
committed
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.
1 parent fe209f3 commit f5f7f4a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

print-802_15_4.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,15 @@ ieee802_15_4_if_print(struct netdissect_options *ndo,
124124
p+= hdrlen;
125125
caplen -= hdrlen;
126126
} else {
127-
u_int16_t panid;
127+
u_int16_t panid = 0;
128128

129129
switch ((fc >> 10) & 0x3) {
130130
case 0x00:
131131
ND_PRINT((ndo,"none "));
132132
break;
133+
case 0x01:
134+
ND_PRINT((ndo,"reserved destination addressing mode"));
135+
return 0;
133136
case 0x02:
134137
panid = EXTRACT_LE_16BITS(p);
135138
p += 2;
@@ -149,6 +152,9 @@ ieee802_15_4_if_print(struct netdissect_options *ndo,
149152
case 0x00:
150153
ND_PRINT((ndo,"none "));
151154
break;
155+
case 0x01:
156+
ND_PRINT((ndo,"reserved source addressing mode"));
157+
return 0;
152158
case 0x02:
153159
if (!(fc & (1 << 6))) {
154160
panid = EXTRACT_LE_16BITS(p);

0 commit comments

Comments
 (0)