Commit e507c6fc authored by David Stevens's avatar David Stevens Committed by Hideaki Yoshifuji

[IPV4]: Fix IGMPv3 timer initialization when device not upped.

parent da9509bd
...@@ -36,8 +36,6 @@ struct in_device ...@@ -36,8 +36,6 @@ struct in_device
rwlock_t lock; rwlock_t lock;
int dead; int dead;
struct in_ifaddr *ifa_list; /* IP ifaddr chain */ struct in_ifaddr *ifa_list; /* IP ifaddr chain */
int mc_initted;
struct ip_mc_list *mc_list; /* IP multicast filter chain */ struct ip_mc_list *mc_list; /* IP multicast filter chain */
rwlock_t mc_lock; /* for mc_tomb */ rwlock_t mc_lock; /* for mc_tomb */
struct ip_mc_list *mc_tomb; struct ip_mc_list *mc_tomb;
......
...@@ -165,6 +165,7 @@ struct in_device *inetdev_init(struct net_device *dev) ...@@ -165,6 +165,7 @@ struct in_device *inetdev_init(struct net_device *dev)
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
devinet_sysctl_register(in_dev, &in_dev->cnf); devinet_sysctl_register(in_dev, &in_dev->cnf);
#endif #endif
ip_mc_init_dev(in_dev);
if (dev->flags & IFF_UP) if (dev->flags & IFF_UP)
ip_mc_up(in_dev); ip_mc_up(in_dev);
out: out:
......
...@@ -1217,8 +1217,8 @@ void ip_mc_down(struct in_device *in_dev) ...@@ -1217,8 +1217,8 @@ void ip_mc_down(struct in_device *in_dev)
ASSERT_RTNL(); ASSERT_RTNL();
if (!in_dev->mc_initted) for (i=in_dev->mc_list; i; i=i->next)
return; igmp_group_dropped(i);
#ifdef CONFIG_IP_MULTICAST #ifdef CONFIG_IP_MULTICAST
in_dev->mr_ifc_count = 0; in_dev->mr_ifc_count = 0;
...@@ -1227,24 +1227,14 @@ void ip_mc_down(struct in_device *in_dev) ...@@ -1227,24 +1227,14 @@ void ip_mc_down(struct in_device *in_dev)
in_dev->mr_gq_running = 0; in_dev->mr_gq_running = 0;
if (del_timer(&in_dev->mr_gq_timer)) if (del_timer(&in_dev->mr_gq_timer))
__in_dev_put(in_dev); __in_dev_put(in_dev);
#endif
for (i=in_dev->mc_list; i; i=i->next)
igmp_group_dropped(i);
#ifdef CONFIG_IP_MULTICAST
igmpv3_clear_delrec(in_dev); igmpv3_clear_delrec(in_dev);
#endif #endif
ip_mc_dec_group(in_dev, IGMP_ALL_HOSTS); ip_mc_dec_group(in_dev, IGMP_ALL_HOSTS);
} }
/* Device going up */ void ip_mc_init_dev(struct in_device *in_dev)
void ip_mc_up(struct in_device *in_dev)
{ {
struct ip_mc_list *i;
ASSERT_RTNL(); ASSERT_RTNL();
in_dev->mc_tomb = 0; in_dev->mc_tomb = 0;
...@@ -1261,12 +1251,20 @@ void ip_mc_up(struct in_device *in_dev) ...@@ -1261,12 +1251,20 @@ void ip_mc_up(struct in_device *in_dev)
#endif #endif
in_dev->mc_lock = RW_LOCK_UNLOCKED; in_dev->mc_lock = RW_LOCK_UNLOCKED;
}
/* Device going up */
void ip_mc_up(struct in_device *in_dev)
{
struct ip_mc_list *i;
ASSERT_RTNL();
ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS); ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS);
for (i=in_dev->mc_list; i; i=i->next) for (i=in_dev->mc_list; i; i=i->next)
igmp_group_added(i); igmp_group_added(i);
in_dev->mc_initted = 1;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment