net: rpl: Do not crash if DIO message contains garbage
Instead of just plain assert, check that the packet we receive is ok before passing it to processing function. Jira: ZEP-2057 Change-Id: I5754c82d16e1522d8fcee561eea280eadeec31ee Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
52d0589c1f
commit
3051fc2035
1 changed files with 4 additions and 1 deletions
|
@ -2966,7 +2966,10 @@ static enum net_verdict handle_dio(struct net_pkt *pkt)
|
|||
}
|
||||
}
|
||||
|
||||
NET_ASSERT_INFO(!pos && !frag, "DIO reading failure");
|
||||
if (pos == 0xffff && !frag) {
|
||||
NET_DBG("DIO reading failure");
|
||||
goto out;
|
||||
}
|
||||
|
||||
net_rpl_process_dio(net_pkt_iface(pkt), &NET_IPV6_HDR(pkt)->src, &dio);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue