RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1459600 - ip-link cannot create ip6gretap tunnel with a specified encaplimit
Summary: ip-link cannot create ip6gretap tunnel with a specified encaplimit
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: iproute
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Phil Sutter
QA Contact: Jaroslav Aster
URL:
Whiteboard:
Depends On:
Blocks: 1470965
TreeView+ depends on / blocked
 
Reported: 2017-06-07 14:34 UTC by Eric Garver
Modified: 2018-04-10 14:30 UTC (History)
5 users (show)

Fixed In Version: iproute-4.11.0-12.el7
Doc Type: Bug Fix
Doc Text:
Cause: Required code to handle 'encaplimit' option for GRE over IPv6 tunnels was missing. Consequence: It was not possible to specify any 'encaplimit' value when creating a GRE over IPv6 tunnel. Fix: Required code to parse the option has been added. Result: 'ip link add' command now correctly parses and evaluates 'encaplimit' option when creating a GRE over IPv6 tunnel.
Clone Of:
Environment:
Last Closed: 2018-04-10 14:28:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0815 0 None None None 2018-04-10 14:30:42 UTC

Description Eric Garver 2017-06-07 14:34:56 UTC
Description of problem:

You cannot specify the encaplimit while creating an ip6gretap tunnel even though both the man page and online help suggest you can.

The code to parse and set encaplimit is non-existent in ip/link_gre6.c. As such this requires upstream work.

Note: iproute2 upstream/master does not have support as of 2017-06-07.

Steps to Reproduce:

$ sudo ip link add dev ns_gre0 type ip6gretap remote fc00::100 local fc00::1 encaplimit none

Usage: ip link { add | set | change | replace | del } NAME
          type { ip6gre | ip6gretap } [ remote ADDR ] [ local ADDR ]
          [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]
          [ hoplimit TTL ] [ encaplimit ELIM ]
          [ tclass TCLASS ] [ flowlabel FLOWLABEL ]
          [ dscp inherit ] [ dev PHYS_DEV ]
          [ noencap ] [ encap { fou | gue | none } ]
          [ encap-sport PORT ] [ encap-dport PORT ]
          [ [no]encap-csum ] [ [no]encap-csum6 ] [ [no]encap-remcsum ]

Where: NAME      := STRING
       ADDR      := IPV6_ADDRESS
       TTL       := { 0..255 } (default=64)
       KEY       := { DOTTED_QUAD | NUMBER }
       ELIM      := { none | 0..255 }(default=4)
       TCLASS    := { 0x0..0xff | inherit }
       FLOWLABEL := { 0x0..0xfffff | inherit }

Comment 2 Eric Garver 2017-06-20 17:44:51 UTC
Support has landed upstream.

  a11b7b71a6eb ("link_gre6: really support encaplimit option")

Comment 4 Jaroslav Aster 2017-11-28 14:39:09 UTC
Hi Phil,

I can confirm that patch works, but I think it's not perfect :-). You can add nonsense (or value out of the range) as encaplimit parametr and it creates device without any warnings and set encaplimit to zero. At least some warning would be nice.

# ip link add dev ns_gre0 type ip6gretap remote fc00::100 local fc00::1  encaplimit blablabla
# ip -d link show dev ns_gre0
12: ns_gre0@NONE: <BROADCAST,MULTICAST> mtu 1434 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 5e:30:64:8f:86:c2 brd ff:ff:ff:ff:ff:ff promiscuity 0 
    ip6gretap remote fc00::100 local fc00::1 hoplimit 64 encaplimit 0 flowlabel 0x00000 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

Comment 5 Phil Sutter 2017-11-28 16:08:28 UTC
Hi Jaroslav,

(In reply to Jaroslav Aster from comment #4)
> I can confirm that patch works, but I think it's not perfect :-). You can
> add nonsense (or value out of the range) as encaplimit parametr and it
> creates device without any warnings and set encaplimit to zero. At least
> some warning would be nice.
> 
> # ip link add dev ns_gre0 type ip6gretap remote fc00::100 local fc00::1 
> encaplimit blablabla
> # ip -d link show dev ns_gre0
> 12: ns_gre0@NONE: <BROADCAST,MULTICAST> mtu 1434 qdisc noop state DOWN mode
> DEFAULT group default qlen 1000
>     link/ether 5e:30:64:8f:86:c2 brd ff:ff:ff:ff:ff:ff promiscuity 0 
>     ip6gretap remote fc00::100 local fc00::1 hoplimit 64 encaplimit 0
> flowlabel 0x00000 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size
> 65536 gso_max_segs 65535

Ah yes, this is definitely a bug. I sent a fix upstream:

https://marc.info/?l=linux-netdev&m=151188421619871&w=2

Thanks for the heads-up!

Comment 7 Phil Sutter 2017-11-29 17:35:33 UTC
Patch got accepted:

commit 56708ae7c9535859223c5b68097b35bf0fae677c
Author: Phil Sutter <phil>
Date:   Tue Nov 28 16:49:58 2017 +0100

    link_gre6: Detect invalid encaplimit values
    
    Looks like a typo: get_u8() returns 0 on success and -1 on error, so the
    error checking here was ineffective.
    
    Fixes: a11b7b71a6eba ("link_gre6: really support encaplimit option")
    Signed-off-by: Phil Sutter <phil>

Comment 11 errata-xmlrpc 2018-04-10 14:28:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:0815


Note You need to log in before you can comment on or make changes to this bug.