]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
IPv6: Fix not join all-router mcast group when forwarding set.
authorLi Wei <lw@cn.fujitsu.com>
Mon, 5 Mar 2012 14:45:17 +0000 (14:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Mar 2012 16:02:33 +0000 (09:02 -0700)
[ 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>
net/ipv6/addrconf.c

index 836c4eaa96f94712450e6d233effdd752ddca79d..a5521c589511a677440c94ff2b225bac132558f6 100644 (file)
@@ -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;
 }