net: lwtunnel: handle MTU calculation in forwading
authorVadim Fedorenko <vfedorenko@novek.ru>
Fri, 25 Jun 2021 16:21:39 +0000 (19:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:32 +0000 (16:56 +0200)
commit4476568069c996f71db39843fa44c9f373f17fde
treeac447f31ed601e6362a0f246699da2fc34a61bf7
parent6939c39a4106199877f93c96d931cff45c0d1dad
net: lwtunnel: handle MTU calculation in forwading

[ Upstream commit fade56410c22cacafb1be9f911a0afd3701d8366 ]

Commit 14972cbd34ff ("net: lwtunnel: Handle fragmentation") moved
fragmentation logic away from lwtunnel by carry encap headroom and
use it in output MTU calculation. But the forwarding part was not
covered and created difference in MTU for output and forwarding and
further to silent drops on ipv4 forwarding path. Fix it by taking
into account lwtunnel encap headroom.

The same commit also introduced difference in how to treat RTAX_MTU
in IPv4 and IPv6 where latter explicitly removes lwtunnel encap
headroom from route MTU. Make IPv4 version do the same.

Fixes: 14972cbd34ff ("net: lwtunnel: Handle fragmentation")
Suggested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/ip.h
include/net/ip6_route.h
net/ipv4/route.c