diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-11-18 12:33:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-18 12:33:19 -0500 |
commit | 866f3b25a2eb60d7529c227a0ecd80c3aba443fd (patch) | |
tree | b11b24cf158a232641548b6c652bf9e001ae1446 /net/ipv4 | |
parent | dda0b38692a7298f433b92b1329867b1ecabb4bb (diff) |
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>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/igmp.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index afb1e82a59f9..50f6bc1a002a 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -1267,26 +1267,32 @@ EXPORT_SYMBOL(ip_mc_inc_group); | |||
1267 | 1267 | ||
1268 | /* | 1268 | /* |
1269 | * Resend IGMP JOIN report; used for bonding. | 1269 | * Resend IGMP JOIN report; used for bonding. |
1270 | * Called with rcu_read_lock() | ||
1270 | */ | 1271 | */ |
1271 | void ip_mc_rejoin_group(struct ip_mc_list *im) | 1272 | void ip_mc_rejoin_groups(struct in_device *in_dev) |
1272 | { | 1273 | { |
1273 | #ifdef CONFIG_IP_MULTICAST | 1274 | #ifdef CONFIG_IP_MULTICAST |
1274 | struct in_device *in_dev = im->interface; | 1275 | struct ip_mc_list *im; |
1276 | int type; | ||
1275 | 1277 | ||
1276 | if (im->multiaddr == IGMP_ALL_HOSTS) | 1278 | for_each_pmc_rcu(in_dev, im) { |
1277 | return; | 1279 | if (im->multiaddr == IGMP_ALL_HOSTS) |
1280 | continue; | ||
1278 | 1281 | ||
1279 | /* a failover is happening and switches | 1282 | /* a failover is happening and switches |
1280 | * must be notified immediately */ | 1283 | * must be notified immediately |
1281 | if (IGMP_V1_SEEN(in_dev)) | 1284 | */ |
1282 | igmp_send_report(in_dev, im, IGMP_HOST_MEMBERSHIP_REPORT); | 1285 | if (IGMP_V1_SEEN(in_dev)) |
1283 | else if (IGMP_V2_SEEN(in_dev)) | 1286 | type = IGMP_HOST_MEMBERSHIP_REPORT; |
1284 | igmp_send_report(in_dev, im, IGMPV2_HOST_MEMBERSHIP_REPORT); | 1287 | else if (IGMP_V2_SEEN(in_dev)) |
1285 | else | 1288 | type = IGMPV2_HOST_MEMBERSHIP_REPORT; |
1286 | igmp_send_report(in_dev, im, IGMPV3_HOST_MEMBERSHIP_REPORT); | 1289 | else |
1290 | type = IGMPV3_HOST_MEMBERSHIP_REPORT; | ||
1291 | igmp_send_report(in_dev, im, type); | ||
1292 | } | ||
1287 | #endif | 1293 | #endif |
1288 | } | 1294 | } |
1289 | EXPORT_SYMBOL(ip_mc_rejoin_group); | 1295 | EXPORT_SYMBOL(ip_mc_rejoin_groups); |
1290 | 1296 | ||
1291 | /* | 1297 | /* |
1292 | * A socket has left a multicast group on device dev | 1298 | * A socket has left a multicast group on device dev |