gre: Fix ttl inherit option

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>
This commit is contained in:
Robert Shearman 2017-11-28 11:16:21 +00:00 committed by Stephen Hemminger
parent 56708ae7c9
commit 079e67816e
1 changed files with 2 additions and 1 deletions

View 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")) {