aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2018-12-06 12:05:42 -0500
committerDavid S. Miller <davem@davemloft.net>2018-12-06 16:26:07 -0500
commit567c5e13be5cc74d24f5eb54cf353c2e2277189b (patch)
treecefe2e937441614164f9a471a921c94801fe8c60 /net/core
parentcf7686a01266de84b3b825acc05026d4e55454e1 (diff)
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. One prominent API through which the notification is invoked is dev_change_flags(). Therefore extend dev_change_flags() with and extra extack argument and update all users. Most of the calls end up just encoding NULL, but several sites (VLAN, ipvlan, VRF, rtnetlink) do have extack available. Since the function declaration line is changed anyway, name the other function arguments to placate checkpatch. Signed-off-by: Petr Machata <petrm@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c4
-rw-r--r--net/core/dev_ioctl.c2
-rw-r--r--net/core/net-sysfs.c2
-rw-r--r--net/core/rtnetlink.c3
4 files changed, 7 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index b801c1aafd70..8bba6f98b545 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7595,11 +7595,13 @@ void __dev_notify_flags(struct net_device *dev, unsigned int old_flags,
7595 * dev_change_flags - change device settings 7595 * dev_change_flags - change device settings
7596 * @dev: device 7596 * @dev: device
7597 * @flags: device state flags 7597 * @flags: device state flags
7598 * @extack: netlink extended ack
7598 * 7599 *
7599 * Change settings on device based state flags. The flags are 7600 * Change settings on device based state flags. The flags are
7600 * in the userspace exported format. 7601 * in the userspace exported format.
7601 */ 7602 */
7602int dev_change_flags(struct net_device *dev, unsigned int flags) 7603int dev_change_flags(struct net_device *dev, unsigned int flags,
7604 struct netlink_ext_ack *extack)
7603{ 7605{
7604 int ret; 7606 int ret;
7605 unsigned int changes, old_flags = dev->flags, old_gflags = dev->gflags; 7607 unsigned int changes, old_flags = dev->flags, old_gflags = dev->gflags;
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 90e8aa36881e..da273ec3cc57 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -234,7 +234,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)
234 234
235 switch (cmd) { 235 switch (cmd) {
236 case SIOCSIFFLAGS: /* Set interface flags */ 236 case SIOCSIFFLAGS: /* Set interface flags */
237 return dev_change_flags(dev, ifr->ifr_flags); 237 return dev_change_flags(dev, ifr->ifr_flags, NULL);
238 238
239 case SIOCSIFMETRIC: /* Set the metric on the interface 239 case SIOCSIFMETRIC: /* Set the metric on the interface
240 (currently unused) */ 240 (currently unused) */
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index bd67c4d0fcfd..ff9fd2bb4ce4 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -337,7 +337,7 @@ NETDEVICE_SHOW_RW(mtu, fmt_dec);
337 337
338static int change_flags(struct net_device *dev, unsigned long new_flags) 338static int change_flags(struct net_device *dev, unsigned long new_flags)
339{ 339{
340 return dev_change_flags(dev, (unsigned int)new_flags); 340 return dev_change_flags(dev, (unsigned int)new_flags, NULL);
341} 341}
342 342
343static ssize_t flags_store(struct device *dev, struct device_attribute *attr, 343static ssize_t flags_store(struct device *dev, struct device_attribute *attr,
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 98876cd1e36c..4c9e4e187600 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2489,7 +2489,8 @@ static int do_setlink(const struct sk_buff *skb,
2489 } 2489 }
2490 2490
2491 if (ifm->ifi_flags || ifm->ifi_change) { 2491 if (ifm->ifi_flags || ifm->ifi_change) {
2492 err = dev_change_flags(dev, rtnl_dev_combine_flags(dev, ifm)); 2492 err = dev_change_flags(dev, rtnl_dev_combine_flags(dev, ifm),
2493 extack);
2493 if (err < 0) 2494 if (err < 0)
2494 goto errout; 2495 goto errout;
2495 } 2496 }