Skip to contentSkip to conversation

IPv6: Fix not join all-router mcast group when forwarding set.

PATCH Superseded Li Wei 2 participants 4 messages Mar 5, 2012 – Mar 6, 2012

Subsystems (3)
lore
Share & tools
lore

Li Wei

author
#0 lore raw

PATCH 1/1 IPv6: Fix not join all-router mcast group when forwarding set.

When forwarding was set and a new net device is register, we need add this device to the all-router mcast group.

---
 net/ipv6/addrconf.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
net/ipv6/addrconf.c +4 -0
index c02280a..1e09591 100644
@@ -434,6 +434,10 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
 	/* Join all-node multicast group */
 	ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes);
 
+	/* Join all-router multicast group if forwarding is set */
+        if (ndev->cnf.forwarding && dev && (dev->flags & IFF_MULTICAST))
+		ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);
+
 	return ndev;
 }
 
Signature · 1 line
1.7.1
maintainer
#1 lore raw

From: Li Wei <[email protected]>
Date: Mon, 05 Mar 2012 17:54:33 +0800

net/ipv6/addrconf.c static struct inet6_dev * ipv6_add_dev(struct net_device *dev) · line 439

Quoted 3 lines
net/ipv6/addrconf.c +3 -0
+	/* Join all-router multicast group if forwarding is set */
+        if (ndev->cnf.forwarding && dev && (dev->flags & IFF_MULTICAST))
+		ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);

Whitespace damaged. First line properly uses a TAB, the next uses spaces and indents too far.

author
#2 lore raw

PATCH v2 1/1 IPv6: Fix not join all-router mcast group when forwarding set.

When forwarding was set and a new net device is register, we need add this device to the all-router mcast group.

---
 net/ipv6/addrconf.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
net/ipv6/addrconf.c +4 -0
index c02280a..6b8ebc5 100644
@@ -434,6 +434,10 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
 	/* Join all-node multicast group */
 	ipv6_dev_mc_inc(dev, &in6addr_linklocal_allnodes);
 
+	/* Join all-router multicast group if forwarding is set */
+	if (ndev->cnf.forwarding && dev && (dev->flags & IFF_MULTICAST))
+		ipv6_dev_mc_inc(dev, &in6addr_linklocal_allrouters);
+
 	return ndev;
 }
 
Signature · 1 line
1.7.1
maintainer Applied
#3 lore raw

From: Li Wei <[email protected]>
Date: Tue, 06 Mar 2012 08:45:17 +0800

Quoted 4 lines

When forwarding was set and a new net device is register, we need add this device to the all-router mcast group.

Ok, since all the necessary code paths hold the rtnl mutex, this should be safe and race free.

Applied, thanks.