]> git.baikalelectronics.ru Git - kernel.git/commit
vxlan: restore dev->mtu setting based on lower device
authorAlexey Kodanev <alexey.kodanev@oracle.com>
Thu, 14 Dec 2017 17:20:00 +0000 (20:20 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Dec 2017 04:05:10 +0000 (23:05 -0500)
commitf81edd8bbd29f483f62230e38e35f2f9eecbd22e
treea73a8cd1becd9bcb331e42107398cb9c609de310
parentf37212c90339d941e1b9b49d5fd57205e4133210
vxlan: restore dev->mtu setting based on lower device

Stefano Brivio says:
    Commit 00553929ae45 ("vxlan: refactor verification and
    application of configuration") introduced a change in the
    behaviour of initial MTU setting: earlier, the MTU for a link
    created on top of a given lower device, without an initial MTU
    specification, was set to the MTU of the lower device minus
    headroom as a result of this path in vxlan_dev_configure():

if (!conf->mtu)
dev->mtu = lowerdev->mtu -
   (use_ipv6 ? VXLAN6_HEADROOM : VXLAN_HEADROOM);

    which is now gone. Now, the initial MTU, in absence of a
    configured value, is simply set by ether_setup() to ETH_DATA_LEN
    (1500 bytes).

    This breaks userspace expectations in case the MTU of
    the lower device is higher than 1500 bytes minus headroom.

This patch restores the previous behaviour on newlink operation. Since
max_mtu can be negative and we update dev->mtu directly, also check it
for valid minimum.

Reported-by: Junhan Yan <juyan@redhat.com>
Fixes: 00553929ae45 ("vxlan: refactor verification and application of configuration")
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c