Skip to content

Commit 6d04032

Browse files
pmachatadavem330
authored andcommitted
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: 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>
1 parent 567c5e1 commit 6d04032

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

include/linux/netdevice.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3611,7 +3611,8 @@ int dev_ioctl(struct net *net, unsigned int cmd, struct ifreq *ifr,
36113611
int dev_ifconf(struct net *net, struct ifconf *, int);
36123612
int dev_ethtool(struct net *net, struct ifreq *);
36133613
unsigned int dev_get_flags(const struct net_device *);
3614-
int __dev_change_flags(struct net_device *, unsigned int flags);
3614+
int __dev_change_flags(struct net_device *dev, unsigned int flags,
3615+
struct netlink_ext_ack *extack);
36153616
int dev_change_flags(struct net_device *dev, unsigned int flags,
36163617
struct netlink_ext_ack *extack);
36173618
void __dev_notify_flags(struct net_device *, unsigned int old_flags,

net/core/dev.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7498,7 +7498,8 @@ unsigned int dev_get_flags(const struct net_device *dev)
74987498
}
74997499
EXPORT_SYMBOL(dev_get_flags);
75007500

7501-
int __dev_change_flags(struct net_device *dev, unsigned int flags)
7501+
int __dev_change_flags(struct net_device *dev, unsigned int flags,
7502+
struct netlink_ext_ack *extack)
75027503
{
75037504
unsigned int old_flags = dev->flags;
75047505
int ret;
@@ -7606,7 +7607,7 @@ int dev_change_flags(struct net_device *dev, unsigned int flags,
76067607
int ret;
76077608
unsigned int changes, old_flags = dev->flags, old_gflags = dev->gflags;
76087609

7609-
ret = __dev_change_flags(dev, flags);
7610+
ret = __dev_change_flags(dev, flags, extack);
76107611
if (ret < 0)
76117612
return ret;
76127613

net/core/rtnetlink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2871,7 +2871,8 @@ int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm)
28712871

28722872
old_flags = dev->flags;
28732873
if (ifm && (ifm->ifi_flags || ifm->ifi_change)) {
2874-
err = __dev_change_flags(dev, rtnl_dev_combine_flags(dev, ifm));
2874+
err = __dev_change_flags(dev, rtnl_dev_combine_flags(dev, ifm),
2875+
NULL);
28752876
if (err < 0)
28762877
return err;
28772878
}

0 commit comments

Comments
 (0)