summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLi Wei <lw@cn.fujitsu.com>2012-03-05 15:45:17 +0100
committerDavid S. Miller <davem@davemloft.net>2012-03-06 22:58:47 +0100
commitd6ddef9e641d1229d4ec841dc75ae703171c3e92 (patch)
treeeb895255cd3d561b189757cc26a5add23702c491 /net
parentcaif-hsi: Set default MTU to 4096 (diff)
downloadlinux-d6ddef9e641d1229d4ec841dc75ae703171c3e92.tar.xz
linux-d6ddef9e641d1229d4ec841dc75ae703171c3e92.zip
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. Signed-off-by: Li Wei <lw@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-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 c02280a4d126..6b8ebc5da0e1 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;
}