net/icmpv6: Verify header's checksum relevantly

Missing verification.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2018-12-04 12:10:16 +01:00 committed by Jukka Rissanen
parent 6c291524bc
commit 93fc23bc7e

View file

@ -603,6 +603,11 @@ enum net_verdict net_icmpv6_input(struct net_pkt *pkt,
{
struct net_icmpv6_handler *cb;
if (net_calc_chksum_icmpv6(pkt) != 0) {
NET_DBG("DROP: invalid checksum");
goto drop;
}
net_stats_update_icmp_recv(net_pkt_iface(pkt));
SYS_SLIST_FOR_EACH_CONTAINER(&handlers, cb, node) {
@ -610,7 +615,7 @@ enum net_verdict net_icmpv6_input(struct net_pkt *pkt,
return cb->handler(pkt);
}
}
drop:
net_stats_update_icmp_drop(net_pkt_iface(pkt));
return NET_DROP;