]> git.baikalelectronics.ru Git - kernel.git/commit
net: ip_tunnel: fix mtu calculation for ETHER tunnel devices
authorHangbin Liu <liuhangbin@gmail.com>
Fri, 9 Jul 2021 03:45:02 +0000 (11:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Jul 2021 20:53:53 +0000 (13:53 -0700)
commitb045e0af415ce92f83d5a32b1832c2b907935f45
treeebbff5d36d7650cc6db1114e5011f9a36c8ed44b
parentfe06956dfba1036234a2f915f5e6c8eb2fb2285c
net: ip_tunnel: fix mtu calculation for ETHER tunnel devices

Commit 9ecf2502bdb5 ("net: ip_tunnel: fix mtu calculation") removed
dev->hard_header_len subtraction when calculate MTU for tunnel devices
as there is an overhead for device that has header_ops.

But there are ETHER tunnel devices, like gre_tap or erspan, which don't
have header_ops but set dev->hard_header_len during setup. This makes
pkts greater than (MTU - ETH_HLEN) could not be xmited. Fix it by
subtracting the ETHER tunnel devices' dev->hard_header_len for MTU
calculation.

Fixes: 9ecf2502bdb5 ("net: ip_tunnel: fix mtu calculation")
Reported-by: Jianlin Shi <jishi@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_tunnel.c