aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2018-10-18 15:25:07 -0400
committerDavid S. Miller <davem@davemloft.net>2018-10-18 19:54:40 -0400
commitd4d576f5ab7edcb757bb33e6a5600666a0b1232d (patch)
treee177391e44be90fea333bbc905025c0abb00bc14
parentb06f9d9f1a907dd03f203e2ce9e27e318c22ba01 (diff)
ip6_tunnel: Fix encapsulation layout
Commit 058214a4d1df ("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 89a23c8b528b ("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 84dad55951b0 ("udp6: fix encap return code for resubmitting"), FoU and GUE work again over IPv6. Fixes: 058214a4d1df ("ip6_tun: Add infrastructure for doing encapsulation") Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/ip6_tunnel.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index a0b6932c3afd..a9d06d4dd057 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1184,11 +1184,6 @@ route_lookup:
1184 } 1184 }
1185 skb_dst_set(skb, dst); 1185 skb_dst_set(skb, dst);
1186 1186
1187 if (encap_limit >= 0) {
1188 init_tel_txopt(&opt, encap_limit);
1189 ipv6_push_frag_opts(skb, &opt.ops, &proto);
1190 }
1191
1192 if (hop_limit == 0) { 1187 if (hop_limit == 0) {
1193 if (skb->protocol == htons(ETH_P_IP)) 1188 if (skb->protocol == htons(ETH_P_IP))
1194 hop_limit = ip_hdr(skb)->ttl; 1189 hop_limit = ip_hdr(skb)->ttl;
@@ -1210,6 +1205,11 @@ route_lookup:
1210 if (err) 1205 if (err)
1211 return err; 1206 return err;
1212 1207
1208 if (encap_limit >= 0) {
1209 init_tel_txopt(&opt, encap_limit);
1210 ipv6_push_frag_opts(skb, &opt.ops, &proto);
1211 }
1212
1213 skb_push(skb, sizeof(struct ipv6hdr)); 1213 skb_push(skb, sizeof(struct ipv6hdr));
1214 skb_reset_network_header(skb); 1214 skb_reset_network_header(skb);
1215 ipv6h = ipv6_hdr(skb); 1215 ipv6h = ipv6_hdr(skb);