IPv6: Fix not join all-router mcast group when forwarding set.
Subsystems (3)
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
@@ -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
David Miller
maintainerFrom: 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.
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
@@ -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
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.
Signed-off-by Li Wei <[email protected]>
Ok, since all the necessary code paths hold the rtnl mutex, this should be safe and race free.
Applied, thanks.