net: Drop received source mcast IPv6 packets

If the source address is multicast, then drop the IPv6 packet.

Change-Id: Ibe733161d67f047469a25a5955c41c335e472945
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2016-05-10 14:25:45 +03:00
commit cce1854b58
2 changed files with 14 additions and 1 deletions

View file

@ -139,7 +139,7 @@ static inline enum net_verdict process_ipv6_pkt(struct net_buf *buf)
} else if (real_len < pkt_len) {
NET_DBG("IPv6 packet size %d buf len %d", pkt_len, real_len);
NET_STATS(++net_stats.ipv6.drop);
return NET_DROP;
goto drop;
}
#if NET_DEBUG > 0
@ -151,6 +151,13 @@ static inline enum net_verdict process_ipv6_pkt(struct net_buf *buf)
} while (0);
#endif /* NET_DEBUG > 0 */
if (net_is_ipv6_addr_mcast(&hdr->src)) {
NET_STATS(++net_stats.ipv6.drop);
NET_DBG("Dropping src multicast packet");
goto drop;
}
drop:
return NET_DROP;
}
#endif /* CONFIG_NET_IPV6 */