Bug 1459605

Summary: Open vSwitch userspace datapath does not handle IP options
Product: Red Hat Enterprise Linux 7 Reporter: Eric Garver <egarver>
Component: openvswitchAssignee: Eelco Chaudron <echaudro>
Status: CLOSED UPSTREAM QA Contact: ovs-qe
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: atragler, egarver, pvauter
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-09 12:25:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eric Garver 2017-06-07 14:46:42 UTC
While OVS userspace datapath (OVS-DPDK) supports GREv6, it does not inter-operate with a native Linux ip6gretap tunnel. This is because the Linux driver uses IPv6 optional headers for the Tunnel Encapsulation Limit (rfc 2473, section 6.6). OVS userspace simply does not parse these IPv6 header inside netdev_tnl_ip_extract_tnl_md(), as such popping the tunnel leaves extra bytes resulting in a mangled decapsulated frame as shown by the tcpdump below.

Unfortunately iproute2 cannot tune or omit this tunnel option, see bug 1459600. So there is no work around here.



Here is the full encapsulated frame:

[root@rhel7-test1 ~]# tcpdump -i ovs-p0 -vv -nn -xx
tcpdump: listening on ovs-p0, link-type EN10MB (Ethernet), capture size 262144 bytes
13:38:06.925539 IP6 (flowlabel 0x2f8ea, hlim 64, next-header unknown (60) payload length: 54) fc00::1 > fc00::100: DSTOPT (opt_type 0x04: len=1)(padn) GREv0, Flags [none], length 4
        ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.1.1.100 tell 10.1.1.1, length 28
        0x0000:  62bb 2795 0041 222a 1d8b 1427 86dd 6002
        0x0010:  f8ea 0036 3c40 fc00 0000 0000 0000 0000
        0x0020:  0000 0000 0001 fc00 0000 0000 0000 0000
        0x0030:  0000 0000 0100 2f00 0401 0401 0100 0000
        0x0040:  6558 ffff ffff ffff 4a0f 73b0 8dd9 0806
        0x0050:  0001 0800 0604 0001 4a0f 73b0 8dd9 0a01
        0x0060:  0101 0000 0000 0000 0a01 0164



Decapsulated ARP frame below. Note the "0000 6558" is the actual GRE header. The preceding 4 bytes are cruft from a truncated IPv6 destination option as noted above.

[root@rhel7-test1 ~]# tcpdump -i br0 -vv -nn -xx
tcpdump: listening on br0, link-type EN10MB (Ethernet), capture size 262144 bytes
13:45:29.103047 65:58:ff:ff:ff:ff > 04:01:01:00:00:00, ethertype Unknown (0xffff), length 50:
        0x0000:  0401 0100 0000 6558 ffff ffff ffff c60f
        0x0010:  a33d f4f4 0806 0001 0800 0604 0001 c60f
        0x0020:  a33d f4f4 0a01 0101 0000 0000 0000 0a01
        0x0030:  0164

Comment 3 Eric Garver 2017-06-28 13:45:59 UTC
Until recently, the kernel did not add IPv6 options for ip6gretap tunnels. This a bug and is fixed by

   89a23c8b528b ("ip6_tunnel: Fix missing tunnel encapsulation limit option")

As such, you should use a 4.12+ kernel to reproduce this issue.

Comment 4 Eelco Chaudron 2017-07-06 12:51:45 UTC
Fix has been send upstream to OVS dev; https://mail.openvswitch.org/pipermail/ovs-dev/2017-July/334993.html

Comment 6 Eelco Chaudron 2018-02-08 15:42:27 UTC
Submitted V2 of the patch to OVS dev; https://mail.openvswitch.org/pipermail/ovs-dev/2018-February/344300.html

Comment 8 Eelco Chaudron 2018-04-09 12:25:52 UTC
The issue was fixed upstream https://github.com/openvswitch/ovs/commit/3456684ed04ea8f443e672a2e600fa5f1c42a9af, will pick up next release.