Skip to contentSkip to conversation

ipv6: don't let node/interface scoped multicast traffic escape on the wire

PATCH Applied Hannes Frederic Sowa 3 participants 3 messages Feb 10, 2013 – Feb 11, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: don't let node/interface scoped multicast traffic escape on the wire

---
 net/ipv6/ip6_output.c | 7 +++++++
 1 file changed, 7 insertions(+)
net/ipv6/ip6_output.c +7 -0
index c953825..155eccf 100644
@@ -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();
Signature · 1 line
1.8.1.2
Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines
---
 net/ipv6/ip6_output.c | 7 +++++++
 1 file changed, 7 insertions(+)
net/ipv6/ip6_output.c +0 -0
index c953825..155eccf 100644
@@ -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);

net/ipv6/ip6_output.c static int ip6_finish_output2(struct sk_buff *skb) · line 132

Quoted 10 lines
net/ipv6/ip6_output.c +7 -0
+
+		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();

--yoshfuji