diff options
author | Veaceslav Falico <vfalico@redhat.com> | 2011-05-23 19:15:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-24 13:26:12 -0400 |
commit | 24cf3af3fed5edcf90bc2a0ed181e6ce1513d2dc (patch) | |
tree | 3e86eba024dbd8c34ca413d5c0cc28fbb321e15d /net | |
parent | be3fc413da9eb17cce0991f214ab019d16c88c41 (diff) |
igmp: call ip_mc_clear_src() only when we have no users of ip_mc_list
In igmp_group_dropped() we call ip_mc_clear_src(), which resets the number
of source filters per mulitcast. However, igmp_group_dropped() is also
called on NETDEV_DOWN, NETDEV_PRE_TYPE_CHANGE and NETDEV_UNREGISTER, which
means that the group might get added back on NETDEV_UP, NETDEV_REGISTER and
NETDEV_POST_TYPE_CHANGE respectively, leaving us with broken source
filters.
To fix that, we must clear the source filters only when there are no users
in the ip_mc_list, i.e. in ip_mc_dec_group() and on device destroy.
Acked-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/igmp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 672e476c8c8..f1d27f6c935 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -1155,20 +1155,18 @@ static void igmp_group_dropped(struct ip_mc_list *im) | |||
1155 | 1155 | ||
1156 | if (!in_dev->dead) { | 1156 | if (!in_dev->dead) { |
1157 | if (IGMP_V1_SEEN(in_dev)) | 1157 | if (IGMP_V1_SEEN(in_dev)) |
1158 | goto done; | 1158 | return; |
1159 | if (IGMP_V2_SEEN(in_dev)) { | 1159 | if (IGMP_V2_SEEN(in_dev)) { |
1160 | if (reporter) | 1160 | if (reporter) |
1161 | igmp_send_report(in_dev, im, IGMP_HOST_LEAVE_MESSAGE); | 1161 | igmp_send_report(in_dev, im, IGMP_HOST_LEAVE_MESSAGE); |
1162 | goto done; | 1162 | return; |
1163 | } | 1163 | } |
1164 | /* IGMPv3 */ | 1164 | /* IGMPv3 */ |
1165 | igmpv3_add_delrec(in_dev, im); | 1165 | igmpv3_add_delrec(in_dev, im); |
1166 | 1166 | ||
1167 | igmp_ifc_event(in_dev); | 1167 | igmp_ifc_event(in_dev); |
1168 | } | 1168 | } |
1169 | done: | ||
1170 | #endif | 1169 | #endif |
1171 | ip_mc_clear_src(im); | ||
1172 | } | 1170 | } |
1173 | 1171 | ||
1174 | static void igmp_group_added(struct ip_mc_list *im) | 1172 | static void igmp_group_added(struct ip_mc_list *im) |
@@ -1305,6 +1303,7 @@ void ip_mc_dec_group(struct in_device *in_dev, __be32 addr) | |||
1305 | *ip = i->next_rcu; | 1303 | *ip = i->next_rcu; |
1306 | in_dev->mc_count--; | 1304 | in_dev->mc_count--; |
1307 | igmp_group_dropped(i); | 1305 | igmp_group_dropped(i); |
1306 | ip_mc_clear_src(i); | ||
1308 | 1307 | ||
1309 | if (!in_dev->dead) | 1308 | if (!in_dev->dead) |
1310 | ip_rt_multicast_event(in_dev); | 1309 | ip_rt_multicast_event(in_dev); |
@@ -1414,7 +1413,8 @@ void ip_mc_destroy_dev(struct in_device *in_dev) | |||
1414 | in_dev->mc_list = i->next_rcu; | 1413 | in_dev->mc_list = i->next_rcu; |
1415 | in_dev->mc_count--; | 1414 | in_dev->mc_count--; |
1416 | 1415 | ||
1417 | igmp_group_dropped(i); | 1416 | /* We've dropped the groups in ip_mc_down already */ |
1417 | ip_mc_clear_src(i); | ||
1418 | ip_ma_put(i); | 1418 | ip_ma_put(i); |
1419 | } | 1419 | } |
1420 | } | 1420 | } |