mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 00:24:12 +08:00
net: add netnotifier event for upper device change
Now when upper device is changed, event is not propagated via RT Netlink to userspace. Userspace might never now about the change. Fix this by adding upper-device-change notifier event. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8513fbd880
commit
42e52bf9e3
@ -1593,6 +1593,7 @@ struct packet_offload {
|
||||
#define NETDEV_RELEASE 0x0012
|
||||
#define NETDEV_NOTIFY_PEERS 0x0013
|
||||
#define NETDEV_JOIN 0x0014
|
||||
#define NETDEV_CHANGEUPPER 0x0015
|
||||
|
||||
extern int register_netdevice_notifier(struct notifier_block *nb);
|
||||
extern int unregister_netdevice_notifier(struct notifier_block *nb);
|
||||
|
@ -4411,7 +4411,7 @@ static int __netdev_upper_dev_link(struct net_device *dev,
|
||||
else
|
||||
list_add_tail_rcu(&upper->list, &dev->upper_dev_list);
|
||||
dev_hold(upper_dev);
|
||||
|
||||
call_netdevice_notifiers(NETDEV_CHANGEUPPER, dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -4471,6 +4471,7 @@ void netdev_upper_dev_unlink(struct net_device *dev,
|
||||
list_del_rcu(&upper->list);
|
||||
dev_put(upper_dev);
|
||||
kfree_rcu(upper, rcu);
|
||||
call_netdevice_notifiers(NETDEV_CHANGEUPPER, dev);
|
||||
}
|
||||
EXPORT_SYMBOL(netdev_upper_dev_unlink);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user