diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 4 | ||||
-rw-r--r-- | net/ipv4/devinet.c | 6 | ||||
-rw-r--r-- | net/ipv4/igmp.c | 22 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 19 | ||||
-rw-r--r-- | net/ipv6/mcast.c | 19 |
5 files changed, 68 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 84945470ab38..560c8c9c03ab 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1017,9 +1017,9 @@ void netdev_state_change(struct net_device *dev) | |||
1017 | } | 1017 | } |
1018 | EXPORT_SYMBOL(netdev_state_change); | 1018 | EXPORT_SYMBOL(netdev_state_change); |
1019 | 1019 | ||
1020 | void netdev_bonding_change(struct net_device *dev) | 1020 | void netdev_bonding_change(struct net_device *dev, unsigned long event) |
1021 | { | 1021 | { |
1022 | call_netdevice_notifiers(NETDEV_BONDING_FAILOVER, dev); | 1022 | call_netdevice_notifiers(event, dev); |
1023 | } | 1023 | } |
1024 | EXPORT_SYMBOL(netdev_bonding_change); | 1024 | EXPORT_SYMBOL(netdev_bonding_change); |
1025 | 1025 | ||
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 3863c3a4223f..07336c6201f0 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1087,6 +1087,12 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1087 | case NETDEV_DOWN: | 1087 | case NETDEV_DOWN: |
1088 | ip_mc_down(in_dev); | 1088 | ip_mc_down(in_dev); |
1089 | break; | 1089 | break; |
1090 | case NETDEV_BONDING_OLDTYPE: | ||
1091 | ip_mc_unmap(in_dev); | ||
1092 | break; | ||
1093 | case NETDEV_BONDING_NEWTYPE: | ||
1094 | ip_mc_remap(in_dev); | ||
1095 | break; | ||
1090 | case NETDEV_CHANGEMTU: | 1096 | case NETDEV_CHANGEMTU: |
1091 | if (inetdev_valid_mtu(dev->mtu)) | 1097 | if (inetdev_valid_mtu(dev->mtu)) |
1092 | break; | 1098 | break; |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 01b4284ed694..d41e5de79a82 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -1298,6 +1298,28 @@ void ip_mc_dec_group(struct in_device *in_dev, __be32 addr) | |||
1298 | } | 1298 | } |
1299 | } | 1299 | } |
1300 | 1300 | ||
1301 | /* Device changing type */ | ||
1302 | |||
1303 | void ip_mc_unmap(struct in_device *in_dev) | ||
1304 | { | ||
1305 | struct ip_mc_list *i; | ||
1306 | |||
1307 | ASSERT_RTNL(); | ||
1308 | |||
1309 | for (i = in_dev->mc_list; i; i = i->next) | ||
1310 | igmp_group_dropped(i); | ||
1311 | } | ||
1312 | |||
1313 | void ip_mc_remap(struct in_device *in_dev) | ||
1314 | { | ||
1315 | struct ip_mc_list *i; | ||
1316 | |||
1317 | ASSERT_RTNL(); | ||
1318 | |||
1319 | for (i = in_dev->mc_list; i; i = i->next) | ||
1320 | igmp_group_added(i); | ||
1321 | } | ||
1322 | |||
1301 | /* Device going down */ | 1323 | /* Device going down */ |
1302 | 1324 | ||
1303 | void ip_mc_down(struct in_device *in_dev) | 1325 | void ip_mc_down(struct in_device *in_dev) |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index c9b369034a40..f216a41ceb22 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -137,6 +137,8 @@ static DEFINE_SPINLOCK(addrconf_verify_lock); | |||
137 | static void addrconf_join_anycast(struct inet6_ifaddr *ifp); | 137 | static void addrconf_join_anycast(struct inet6_ifaddr *ifp); |
138 | static void addrconf_leave_anycast(struct inet6_ifaddr *ifp); | 138 | static void addrconf_leave_anycast(struct inet6_ifaddr *ifp); |
139 | 139 | ||
140 | static void addrconf_bonding_change(struct net_device *dev, | ||
141 | unsigned long event); | ||
140 | static int addrconf_ifdown(struct net_device *dev, int how); | 142 | static int addrconf_ifdown(struct net_device *dev, int how); |
141 | 143 | ||
142 | static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); | 144 | static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); |
@@ -2582,6 +2584,10 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, | |||
2582 | return notifier_from_errno(err); | 2584 | return notifier_from_errno(err); |
2583 | } | 2585 | } |
2584 | break; | 2586 | break; |
2587 | case NETDEV_BONDING_OLDTYPE: | ||
2588 | case NETDEV_BONDING_NEWTYPE: | ||
2589 | addrconf_bonding_change(dev, event); | ||
2590 | break; | ||
2585 | } | 2591 | } |
2586 | 2592 | ||
2587 | return NOTIFY_OK; | 2593 | return NOTIFY_OK; |
@@ -2595,6 +2601,19 @@ static struct notifier_block ipv6_dev_notf = { | |||
2595 | .priority = 0 | 2601 | .priority = 0 |
2596 | }; | 2602 | }; |
2597 | 2603 | ||
2604 | static void addrconf_bonding_change(struct net_device *dev, unsigned long event) | ||
2605 | { | ||
2606 | struct inet6_dev *idev; | ||
2607 | ASSERT_RTNL(); | ||
2608 | |||
2609 | idev = __in6_dev_get(dev); | ||
2610 | |||
2611 | if (event == NETDEV_BONDING_NEWTYPE) | ||
2612 | ipv6_mc_remap(idev); | ||
2613 | else if (event == NETDEV_BONDING_OLDTYPE) | ||
2614 | ipv6_mc_unmap(idev); | ||
2615 | } | ||
2616 | |||
2598 | static int addrconf_ifdown(struct net_device *dev, int how) | 2617 | static int addrconf_ifdown(struct net_device *dev, int how) |
2599 | { | 2618 | { |
2600 | struct inet6_dev *idev; | 2619 | struct inet6_dev *idev; |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 71c3dacec1ed..f9fcf690bd5d 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -2249,6 +2249,25 @@ static void igmp6_timer_handler(unsigned long data) | |||
2249 | ma_put(ma); | 2249 | ma_put(ma); |
2250 | } | 2250 | } |
2251 | 2251 | ||
2252 | /* Device changing type */ | ||
2253 | |||
2254 | void ipv6_mc_unmap(struct inet6_dev *idev) | ||
2255 | { | ||
2256 | struct ifmcaddr6 *i; | ||
2257 | |||
2258 | /* Install multicast list, except for all-nodes (already installed) */ | ||
2259 | |||
2260 | read_lock_bh(&idev->lock); | ||
2261 | for (i = idev->mc_list; i; i = i->next) | ||
2262 | igmp6_group_dropped(i); | ||
2263 | read_unlock_bh(&idev->lock); | ||
2264 | } | ||
2265 | |||
2266 | void ipv6_mc_remap(struct inet6_dev *idev) | ||
2267 | { | ||
2268 | ipv6_mc_up(idev); | ||
2269 | } | ||
2270 | |||
2252 | /* Device going down */ | 2271 | /* Device going down */ |
2253 | 2272 | ||
2254 | void ipv6_mc_down(struct inet6_dev *idev) | 2273 | void ipv6_mc_down(struct inet6_dev *idev) |