Thread (3 messages) flat view 3 messages, 2 authors, 2021-01-29

Re: [net v2] net: ip_tunnel: fix mtu calculation

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2021-01-29 02:22:53

On Thu, Jan 28, 2021 at 8:02 PM Vadim Fedorenko [off-list ref] wrote:
dev->hard_header_len for tunnel interface is set only when header_ops
are set too and already contains full overhead of any tunnel encapsulation.
That's why there is not need to use this overhead twice in mtu calc.

Fixes: fdafed459998 ("ip_gre: set dev->hard_header_len and dev->needed_headroom properly")
Reported-by: Slava Bacherikov <redacted>
Signed-off-by: Vadim Fedorenko <redacted>
Acked-by: Willem de Bruijn <willemb@google.com>

It is easy to verify that if hard_header_len is zero the calculation
does not change. And as discussed, ip_gre is the only ip_tunnel
user that sometimes has it non-zero (for legacy reasons that
we cannot revert now). In that case it is equivalent to tun->hlen +
sizeof(struct iphdr). LGTM. Thanks!

Btw, ip6_gre might need the same after commit 832ba596494b
("net: ip6_gre: set dev->hard_header_len when using header_ops")
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help