net: Add extack to netdev_notifier_info
Add netlink_ext_ack to netdev_notifier_info to allow notifier handlers to return errors to userspace. Clean up the initialization in dev.c such that extack is easily added in subsequent patches where relevant. Specifically, remove the init call in call_netdevice_notifiers_info and have callers initalize on stack when info is declared. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
6621dd29eb
commit
51d0c04795
@@ -2309,7 +2309,8 @@ int register_netdevice_notifier(struct notifier_block *nb);
|
||||
int unregister_netdevice_notifier(struct notifier_block *nb);
|
||||
|
||||
struct netdev_notifier_info {
|
||||
struct net_device *dev;
|
||||
struct net_device *dev;
|
||||
struct netlink_ext_ack *extack;
|
||||
};
|
||||
|
||||
struct netdev_notifier_change_info {
|
||||
@@ -2334,6 +2335,7 @@ static inline void netdev_notifier_info_init(struct netdev_notifier_info *info,
|
||||
struct net_device *dev)
|
||||
{
|
||||
info->dev = dev;
|
||||
info->extack = NULL;
|
||||
}
|
||||
|
||||
static inline struct net_device *
|
||||
@@ -2342,6 +2344,12 @@ netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
|
||||
return info->dev;
|
||||
}
|
||||
|
||||
static inline struct netlink_ext_ack *
|
||||
netdev_notifier_info_to_extack(const struct netdev_notifier_info *info)
|
||||
{
|
||||
return info->extack;
|
||||
}
|
||||
|
||||
int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user