Skip to contentSkip to conversation

ipv6: stop multicast forwarding to process interface scoped addresses

PATCH Superseded Hannes Frederic Sowa 2 participants 2 messages Mar 7, 2013 – Mar 8, 2013

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 3/4 ipv6: stop multicast forwarding to process interface scoped addresses

v2:
a) used struct ipv6_addr_props

v3:
a) reverted changes for ipv6_addr_props

---
 net/ipv6/ip6_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6_input.c +1 -1
index b1876e5..b73bcc2 100644
@@ -281,7 +281,7 @@ int ip6_mc_input(struct sk_buff *skb)
 	 *      IPv6 multicast router mode is now supported ;)
 	 */
 	if (dev_net(skb->dev)->ipv6.devconf_all->mc_forwarding &&
-	    !(ipv6_addr_type(&hdr->daddr) & IPV6_ADDR_LINKLOCAL) &&
+	    !__ipv6_addr_needs_scope_id((ipv6_addr_type(&hdr->daddr))) &&
 	    likely(!(IP6CB(skb)->flags & IP6SKB_FORWARDED))) {
 		/*
 		 * Okay, we try to forward - split and duplicate
Signature · 1 line
1.8.1.4
#1 lore raw
Quoted 18 lines · Hannes Frederic Sowa

v2:
a) used struct ipv6_addr_props

v3:
a) reverted changes for ipv6_addr_props

---
 net/ipv6/ip6_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6_input.c +0 -0
index b1876e5..b73bcc2 100644

net/ipv6/ip6_input.c int ip6_mc_input(struct sk_buff *skb) · line 287

Quoted 8 lines
net/ipv6/ip6_input.c +1 -1
@@ -281,7 +281,7 @@ int ip6_mc_input(struct sk_buff *skb)
 	 *      IPv6 multicast router mode is now supported ;)
 	 */
 	if (dev_net(skb->dev)->ipv6.devconf_all->mc_forwarding &&
-	    !(ipv6_addr_type(&hdr->daddr) & IPV6_ADDR_LINKLOCAL) &&
+	    !__ipv6_addr_needs_scope_id((ipv6_addr_type(&hdr->daddr))) &&
 	    likely(!(IP6CB(skb)->flags & IP6SKB_FORWARDED))) {
 		/*
 		 * Okay, we try to forward - split and duplicate

Well, I think __ipv6_addr_needs_scope_id() should be used just for filling "sin6_scope_id", not for forwarding decision.

Since we always have multicast address, so

            !(ipv6_addr_type(&hdr->daddr) & (IPV6_ADDR_LOOPBACK|IPV6_ADDR_LINKLOCAL))

is just fine for disallow "forwarding" multicast for interface-local addresses.

--yoshfuji