summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorLi Wei <lw@cn.fujitsu.com>2012-03-05 14:45:17 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-19 09:02:33 -0700
commit5a5598f6ac246a7b6c67caaeaab8d69f1414c252 (patch)
treec734790fe483a4eb04aaae2fd5e0810637e0202d /net/ipv6
parent8d360a280ade8e4a154fef4eb1759819d4ecdd8e (diff)
downloadlinux-stable-5a5598f6ac246a7b6c67caaeaab8d69f1414c252.tar.gz
linux-stable-5a5598f6ac246a7b6c67caaeaab8d69f1414c252.tar.bz2
linux-stable-5a5598f6ac246a7b6c67caaeaab8d69f1414c252.zip
IPv6: Fix not join all-router mcast group when forwarding set.
[ Upstream commit d6ddef9e641d1229d4ec841dc75ae703171c3e92 ] 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 <lw@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 836c4eaa96f9..a5521c589511 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -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;
}