Fixed I-Am-Router-To-Network handling in cases of a malformed packet. The packet seen in the field was a I-Am-Router-To-Network but there was an extra "Data" byte of 0x55 at the end. Thank you, Ettore.

This commit is contained in:
skarg
2015-03-20 19:47:57 +00:00
parent e98f74424d
commit 9631b65fc5
2 changed files with 29 additions and 26 deletions
+5 -2
View File
@@ -108,16 +108,19 @@ static void My_Router_Handler(
}
}
printf("\nNetworks: ");
while (npdu_len) {
while (npdu_len >= 2) {
len = decode_unsigned16(&npdu[npdu_offset], &dnet);
printf("%hu", dnet);
npdu_len -= len;
npdu_offset += len;
if (npdu_len) {
if (npdu_len >= 2) {
printf(", ");
}
}
printf("\n");
if (npdu_len) {
printf("Warning! Extra byte received!\n");
}
break;
case NETWORK_MESSAGE_I_COULD_BE_ROUTER_TO_NETWORK:
case NETWORK_MESSAGE_REJECT_MESSAGE_TO_NETWORK: