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:
Jukka Rissanen 2017-04-25 14:33:38 +03:00
commit 3051fc2035

View file

@ -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);