]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
gre: Fix ttl inherit option
authorRobert Shearman <rs823p@att.com>
Tue, 28 Nov 2017 11:16:21 +0000 (11:16 +0000)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 28 Nov 2017 17:48:22 +0000 (09:48 -0800)
Specifying "... ttl inherit" currently does nothing on a GRE link
modify since the previous ttl value is retrieved up front. Fix this by
explicitly setting ttl to 0 when "inherit" is specified for the
option, since 0 represents the semantics of inherit.

Signed-off-by: Robert Shearman <rs823p@att.com>
ip/link_gre.c

index 35782caaa68b4c193b6873f370d9590110ed1a4a..43cb1af6196a1aa0b64cf3e7efd4ad115ae0347c 100644 (file)
@@ -276,7 +276,8 @@ get_failed:
                                if (uval > 255)
                                        invarg("TTL must be <= 255\n", *argv);
                                ttl = uval;
-                       }
+                       } else
+                               ttl = 0;
                } else if (!matches(*argv, "tos") ||
                           !matches(*argv, "tclass") ||
                           !matches(*argv, "dsfield")) {