From a615d90f7e20de92ff59d3825f62aa7c1199dba8 Mon Sep 17 00:00:00 2001 From: YOSHIFUJI Hideaki Date: Thu, 18 Jan 2007 16:11:56 +0100 Subject: [PATCH] [IPV6] Fix joining all-node multicast group. Signed-off-by: Adrian Bunk --- net/ipv6/addrconf.c | 4 ++++ net/ipv6/mcast.c | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index c5005b23ec05..e8f144171880 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -321,6 +321,7 @@ void in6_dev_finish_destroy(struct inet6_dev *idev) static struct inet6_dev * ipv6_add_dev(struct net_device *dev) { struct inet6_dev *ndev; + struct in6_addr maddr; ASSERT_RTNL(); @@ -406,6 +407,9 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) dev->ip6_ptr = ndev; write_unlock_bh(&addrconf_lock); + /* Join all-node multicast group */ + ipv6_addr_all_nodes(&maddr); + ipv6_dev_mc_inc(dev, &maddr); } return ndev; } diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 807c021d64a2..c75cd1c4d6b8 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c @@ -2252,8 +2252,6 @@ void ipv6_mc_up(struct inet6_dev *idev) void ipv6_mc_init_dev(struct inet6_dev *idev) { - struct in6_addr maddr; - write_lock_bh(&idev->lock); rwlock_init(&idev->mc_lock); idev->mc_gq_running = 0; @@ -2269,10 +2267,6 @@ void ipv6_mc_init_dev(struct inet6_dev *idev) idev->mc_maxdelay = IGMP6_UNSOLICITED_IVAL; idev->mc_v1_seen = 0; write_unlock_bh(&idev->lock); - - /* Add all-nodes address. */ - ipv6_addr_all_nodes(&maddr); - ipv6_dev_mc_inc(idev->dev, &maddr); } /* -- 2.39.5