aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2015-12-03 21:12:33 +0100
committerDavid S. Miller <davem@davemloft.net>2015-12-05 17:41:42 -0500
commita1a66b1100373ead1fa2383bc3dee42c508bb504 (patch)
treea429c324efd573280e1e40c54146f5fc072ea2dc /net/batman-adv
parentipv6: Only act upon NETDEV_*_TYPE_CHANGE if we have ipv6 addresses (diff)
downloadlinux-dev-a1a66b1100373ead1fa2383bc3dee42c508bb504.tar.xz
linux-dev-a1a66b1100373ead1fa2383bc3dee42c508bb504.zip
batman-adv: Act on NETDEV_*_TYPE_CHANGE events
A network interface can change type. It may change from a type which batman does not support, e.g. hdlc, to one it does, e.g. hdlc-eth. When an interface changes type, it sends two notifications. Handle these notifications. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/hard-interface.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index aa8867e1d983..a58184fdf5fd 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -709,7 +709,8 @@ static int batadv_hard_if_event(struct notifier_block *this,
}
hard_iface = batadv_hardif_get_by_netdev(net_dev);
- if (!hard_iface && event == NETDEV_REGISTER)
+ if (!hard_iface && (event == NETDEV_REGISTER ||
+ event == NETDEV_POST_TYPE_CHANGE))
hard_iface = batadv_hardif_add_interface(net_dev);
if (!hard_iface)
@@ -724,6 +725,7 @@ static int batadv_hard_if_event(struct notifier_block *this,
batadv_hardif_deactivate_interface(hard_iface);
break;
case NETDEV_UNREGISTER:
+ case NETDEV_PRE_TYPE_CHANGE:
list_del_rcu(&hard_iface->list);
batadv_hardif_remove_interface(hard_iface);