Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- include/linux/netdevice.h | 2 ++
- net/core/dev.c | 31 +++++++++++++++++++------------
+ include/linux/netdevice.h | 1 +
+ net/core/dev.c | 32 ++++++++++++++++++++------------
net/core/rtnetlink.c | 13 +++++++++++--
3 files changed, 32 insertions(+), 14 deletions(-)
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -3313,6 +3313,8 @@ int dev_set_alias(struct net_device *, c
+@@ -3313,6 +3313,7 @@ int dev_set_alias(struct net_device *, c
int dev_change_net_namespace(struct net_device *, struct net *, const char *);
int __dev_set_mtu(struct net_device *, int);
int dev_set_mtu(struct net_device *, int);
-+int dev_validate_mtu(struct net_device *dev, int mtu,
-+ struct netlink_ext_ack *extack);
++int dev_validate_mtu(struct net_device *dev, int mtu);
void dev_set_group(struct net_device *, int);
int dev_set_mac_address(struct net_device *, struct sockaddr *);
int dev_change_carrier(struct net_device *, bool new_carrier);
- dev->name, new_mtu, dev->max_mtu);
- return -EINVAL;
- }
-+ err = dev_validate_mtu(dev, new_mtu, extack);
++ err = dev_validate_mtu(dev, new_mtu);
+ if (err)
+ return err;
if (!netif_device_present(dev))
return -ENODEV;
-@@ -7769,6 +7760,22 @@ int init_dummy_netdev(struct net_device
+@@ -7769,6 +7760,23 @@ int init_dummy_netdev(struct net_device
EXPORT_SYMBOL_GPL(init_dummy_netdev);
-+int dev_validate_mtu(struct net_device *dev, int new_mtu,
-+ struct netlink_ext_ack *extack)
++int dev_validate_mtu(struct net_device *dev, int new_mtu)
+{
+ /* MTU must be positive, and in range */
+ if (new_mtu < 0 || new_mtu < dev->min_mtu) {
-+ NL_SET_ERR_MSG(extack, "mtu less than device minimum");
++ net_err_ratelimited("%s: Invalid MTU %d requested, hw min %d\n",
++ dev->name, new_mtu, dev->min_mtu);
+ return -EINVAL;
+ }
+
+ if (dev->max_mtu > 0 && new_mtu > dev->max_mtu) {
-+ NL_SET_ERR_MSG(extack, "mtu greater than device maximum");
++ net_err_ratelimited("%s: Invalid MTU %d requested, hw max %d\n",
++ dev->name, new_mtu, dev->max_mtu);
+ return -EINVAL;
+ }
+ return 0;
+ u32 mtu = nla_get_u32(tb[IFLA_MTU]);
+ int err;
+
-+ err = dev_validate_mtu(dev, mtu, NULL);
++ err = dev_validate_mtu(dev, mtu);
+ if (err) {
+ free_netdev(dev);
+ return ERR_PTR(err);