[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160907133535.2cfac7bc@xeon-e3>
Date: Wed, 7 Sep 2016 13:35:35 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Jarod Wilson <jarod@...hat.com>
Cc: David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: Minimum MTU Mess
On Wed, 7 Sep 2016 15:53:56 -0400
Jarod Wilson <jarod@...hat.com> wrote:
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -6466,9 +6466,17 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
> if (new_mtu == dev->mtu)
> return 0;
>
> - /* MTU must be positive. */
> - if (new_mtu < 0)
> + if (new_mtu < dev->min_mtu) {
> + netdev_err(dev, "Invalid MTU %d requested, hw min %d\n",
> + new_mtu, dev->min_mtu);
> return -EINVAL;
> + }
> +
> + if (new_mtu > dev->max_mtu) {
> + netdev_err(dev, "Invalid MTU %d requested, hw max %d\n",
> + new_mtu, dev->min_mtu);
> + return -EINVAL;
> + }
>
Maybe don't log something that can be triggered from a user program.
Or at least rate limit it.
Powered by blists - more mailing lists