From: Hannes Frederic Sowa Date: Sun, 10 Feb 2013 02:33:35 +0000 (+0000) Subject: ipv6: don't let node/interface scoped multicast traffic escape on the wire X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dd40851521361e07c1f61e79cca941a63ad311bc;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ipv6: don't let node/interface scoped multicast traffic escape on the wire Reported-by: Erik Hugne Cc: Erik Hugne Cc: YOSHIFUJI Hideaki Signed-off-by: Hannes Frederic Sowa Acked-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller --- diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index c953825f9098..155eccfa7760 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -120,6 +120,13 @@ static int ip6_finish_output2(struct sk_buff *skb) IP6_UPD_PO_STATS(dev_net(dev), idev, IPSTATS_MIB_OUTMCAST, skb->len); + + if (IPV6_ADDR_MC_SCOPE(&ipv6_hdr(skb)->daddr) <= + IPV6_ADDR_SCOPE_NODELOCAL && + !(dev->flags & IFF_LOOPBACK)) { + kfree_skb(skb); + return 0; + } } rcu_read_lock_bh();