diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2018-07-27 13:43:23 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-29 12:57:26 -0700 |
commit | 7a4c53bee3324ac00bf964aa2f82d15d279e86e4 (patch) | |
tree | 39a64c3a2deb287eafc2bea2b4fa88d9ddf23b09 /include/linux/netdevice.h | |
parent | 3e7a50ceb11ea75c27e944f1a01e478fd62a2d8d (diff) | |
download | op-kernel-dev-7a4c53bee3324ac00bf964aa2f82d15d279e86e4.zip op-kernel-dev-7a4c53bee3324ac00bf964aa2f82d15d279e86e4.tar.gz |
net: report invalid mtu value via netlink extack
If an invalid MTU value is set through rtnetlink return extra error
information instead of putting message in kernel log. For other cases
where there is no visible API, keep the error report in the log.
Example:
# ip li set dev enp12s0 mtu 10000
Error: mtu greater than device maximum.
# ifconfig enp12s0 mtu 10000
SIOCSIFMTU: Invalid argument
# dmesg | tail -1
[ 2047.795467] enp12s0: mtu greater than device maximum
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c1295c7..9c91746 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3546,6 +3546,8 @@ int dev_set_alias(struct net_device *, const char *, size_t); int dev_get_alias(const struct net_device *, char *, size_t); int dev_change_net_namespace(struct net_device *, struct net *, const char *); int __dev_set_mtu(struct net_device *, int); +int dev_set_mtu_ext(struct net_device *dev, int mtu, + struct netlink_ext_ack *extack); int dev_set_mtu(struct net_device *, int); int dev_change_tx_queue_len(struct net_device *, unsigned long); void dev_set_group(struct net_device *, int); |