]> git.baikalelectronics.ru Git - kernel.git/commit
ip6_tunnel: Fix encapsulation layout
authorStefano Brivio <sbrivio@redhat.com>
Thu, 18 Oct 2018 19:25:07 +0000 (21:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Oct 2018 23:54:40 +0000 (16:54 -0700)
commitab48ac052619329ceeeadbf9b0291cb1b72281a3
treee177391e44be90fea333bbc905025c0abb00bc14
parentd2863964a6c057b1c5a272b893b3a8810494b565
ip6_tunnel: Fix encapsulation layout

Commit b1a1b2bc49fd ("ip6_tun: Add infrastructure for doing
encapsulation") added the ip6_tnl_encap() call in ip6_tnl_xmit(), before
the call to ipv6_push_frag_opts() to append the IPv6 Tunnel Encapsulation
Limit option (option 4, RFC 2473, par. 5.1) to the outer IPv6 header.

As long as the option didn't actually end up in generated packets, this
wasn't an issue. Then commit 9e183c130cac ("ip6_tunnel: Fix missing tunnel
encapsulation limit option") fixed sending of this option, and the
resulting layout, e.g. for FoU, is:

.-------------------.------------.----------.-------------------.----- - -
| Outer IPv6 Header | UDP header | Option 4 | Inner IPv6 Header | Payload
'-------------------'------------'----------'-------------------'----- - -

Needless to say, FoU and GUE (at least) won't work over IPv6. The option
is appended by default, and I couldn't find a way to disable it with the
current iproute2.

Turn this into a more reasonable:

.-------------------.----------.------------.-------------------.----- - -
| Outer IPv6 Header | Option 4 | UDP header | Inner IPv6 Header | Payload
'-------------------'----------'------------'-------------------'----- - -

With this, and with c7125f96fd7b ("udp6: fix encap return code for
resubmitting"), FoU and GUE work again over IPv6.

Fixes: b1a1b2bc49fd ("ip6_tun: Add infrastructure for doing encapsulation")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_tunnel.c