mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
bonding: IGMP handling cleanup
Instead of iterating in_dev->mc_list from bonding driver, its better to call a helper function provided by igmp.c Details of implementation (locking) are private to igmp code. ip_mc_rejoin_group(struct ip_mc_list *im) becomes ip_mc_rejoin_groups(struct in_device *in_dev); Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
dda0b38692
commit
866f3b25a2
3 changed files with 22 additions and 20 deletions
|
@ -873,15 +873,11 @@ static void bond_mc_del(struct bonding *bond, void *addr)
|
||||||
static void __bond_resend_igmp_join_requests(struct net_device *dev)
|
static void __bond_resend_igmp_join_requests(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct in_device *in_dev;
|
struct in_device *in_dev;
|
||||||
struct ip_mc_list *im;
|
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
in_dev = __in_dev_get_rcu(dev);
|
in_dev = __in_dev_get_rcu(dev);
|
||||||
if (in_dev) {
|
if (in_dev)
|
||||||
for (im = in_dev->mc_list; im; im = im->next)
|
ip_mc_rejoin_groups(in_dev);
|
||||||
ip_mc_rejoin_group(im);
|
|
||||||
}
|
|
||||||
|
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ extern void ip_mc_unmap(struct in_device *);
|
||||||
extern void ip_mc_remap(struct in_device *);
|
extern void ip_mc_remap(struct in_device *);
|
||||||
extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr);
|
extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr);
|
||||||
extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
|
extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
|
||||||
extern void ip_mc_rejoin_group(struct ip_mc_list *im);
|
extern void ip_mc_rejoin_groups(struct in_device *in_dev);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1267,26 +1267,32 @@ EXPORT_SYMBOL(ip_mc_inc_group);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Resend IGMP JOIN report; used for bonding.
|
* Resend IGMP JOIN report; used for bonding.
|
||||||
|
* Called with rcu_read_lock()
|
||||||
*/
|
*/
|
||||||
void ip_mc_rejoin_group(struct ip_mc_list *im)
|
void ip_mc_rejoin_groups(struct in_device *in_dev)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_IP_MULTICAST
|
#ifdef CONFIG_IP_MULTICAST
|
||||||
struct in_device *in_dev = im->interface;
|
struct ip_mc_list *im;
|
||||||
|
int type;
|
||||||
|
|
||||||
|
for_each_pmc_rcu(in_dev, im) {
|
||||||
if (im->multiaddr == IGMP_ALL_HOSTS)
|
if (im->multiaddr == IGMP_ALL_HOSTS)
|
||||||
return;
|
continue;
|
||||||
|
|
||||||
/* a failover is happening and switches
|
/* a failover is happening and switches
|
||||||
* must be notified immediately */
|
* must be notified immediately
|
||||||
|
*/
|
||||||
if (IGMP_V1_SEEN(in_dev))
|
if (IGMP_V1_SEEN(in_dev))
|
||||||
igmp_send_report(in_dev, im, IGMP_HOST_MEMBERSHIP_REPORT);
|
type = IGMP_HOST_MEMBERSHIP_REPORT;
|
||||||
else if (IGMP_V2_SEEN(in_dev))
|
else if (IGMP_V2_SEEN(in_dev))
|
||||||
igmp_send_report(in_dev, im, IGMPV2_HOST_MEMBERSHIP_REPORT);
|
type = IGMPV2_HOST_MEMBERSHIP_REPORT;
|
||||||
else
|
else
|
||||||
igmp_send_report(in_dev, im, IGMPV3_HOST_MEMBERSHIP_REPORT);
|
type = IGMPV3_HOST_MEMBERSHIP_REPORT;
|
||||||
|
igmp_send_report(in_dev, im, type);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(ip_mc_rejoin_group);
|
EXPORT_SYMBOL(ip_mc_rejoin_groups);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A socket has left a multicast group on device dev
|
* A socket has left a multicast group on device dev
|
||||||
|
|
Loading…
Add table
Reference in a new issue