Commit 6d040321 authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

net: core: dev: Add extack argument to __dev_change_flags()

In order to pass extack together with NETDEV_PRE_UP notifications, it's
necessary to route the extack to __dev_open() from diverse (possibly
indirect) callers. The last missing API is __dev_change_flags().

Therefore extend __dev_change_flags() with and extra extack argument and
update the two existing users.

Since the function declaration line is changed anyway, name the struct
net_device argument to placate checkpatch.
Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 567c5e13
...@@ -3611,7 +3611,8 @@ int dev_ioctl(struct net *net, unsigned int cmd, struct ifreq *ifr, ...@@ -3611,7 +3611,8 @@ int dev_ioctl(struct net *net, unsigned int cmd, struct ifreq *ifr,
int dev_ifconf(struct net *net, struct ifconf *, int); int dev_ifconf(struct net *net, struct ifconf *, int);
int dev_ethtool(struct net *net, struct ifreq *); int dev_ethtool(struct net *net, struct ifreq *);
unsigned int dev_get_flags(const struct net_device *); unsigned int dev_get_flags(const struct net_device *);
int __dev_change_flags(struct net_device *, unsigned int flags); int __dev_change_flags(struct net_device *dev, unsigned int flags,
struct netlink_ext_ack *extack);
int dev_change_flags(struct net_device *dev, unsigned int flags, int dev_change_flags(struct net_device *dev, unsigned int flags,
struct netlink_ext_ack *extack); struct netlink_ext_ack *extack);
void __dev_notify_flags(struct net_device *, unsigned int old_flags, void __dev_notify_flags(struct net_device *, unsigned int old_flags,
......
...@@ -7498,7 +7498,8 @@ unsigned int dev_get_flags(const struct net_device *dev) ...@@ -7498,7 +7498,8 @@ unsigned int dev_get_flags(const struct net_device *dev)
} }
EXPORT_SYMBOL(dev_get_flags); EXPORT_SYMBOL(dev_get_flags);
int __dev_change_flags(struct net_device *dev, unsigned int flags) int __dev_change_flags(struct net_device *dev, unsigned int flags,
struct netlink_ext_ack *extack)
{ {
unsigned int old_flags = dev->flags; unsigned int old_flags = dev->flags;
int ret; int ret;
...@@ -7606,7 +7607,7 @@ int dev_change_flags(struct net_device *dev, unsigned int flags, ...@@ -7606,7 +7607,7 @@ int dev_change_flags(struct net_device *dev, unsigned int flags,
int ret; int ret;
unsigned int changes, old_flags = dev->flags, old_gflags = dev->gflags; unsigned int changes, old_flags = dev->flags, old_gflags = dev->gflags;
ret = __dev_change_flags(dev, flags); ret = __dev_change_flags(dev, flags, extack);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -2871,7 +2871,8 @@ int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm) ...@@ -2871,7 +2871,8 @@ int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm)
old_flags = dev->flags; old_flags = dev->flags;
if (ifm && (ifm->ifi_flags || ifm->ifi_change)) { if (ifm && (ifm->ifi_flags || ifm->ifi_change)) {
err = __dev_change_flags(dev, rtnl_dev_combine_flags(dev, ifm)); err = __dev_change_flags(dev, rtnl_dev_combine_flags(dev, ifm),
NULL);
if (err < 0) if (err < 0)
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment