Also add "noexternal" variant to be inline
with geneve and vxlan tunnel types.

Signed-off-by: Serhey Popovych <[email protected]>
---
 ip/link_gre.c         |    3 +++
 ip/link_ip6tnl.c      |    4 +++-
 ip/link_iptnl.c       |    4 +++-
 man/man8/ip-link.8.in |    6 ++++++
 4 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ip/link_gre.c b/ip/link_gre.c
index 896bb19..b383061 100644
--- a/ip/link_gre.c
+++ b/ip/link_gre.c
@@ -43,6 +43,7 @@ static void print_usage(FILE *f)
                "                            [ [no]encap-csum ]\n"
                "                            [ [no]encap-csum6 ]\n"
                "                            [ [no]encap-remcsum ]\n"
+               "                            [ [no]external ]\n"
                "                            [ fwmark MARK ]\n"
                "                            [ erspan IDX ]\n"
                "\n"
@@ -288,6 +289,8 @@ get_failed:
                        encapflags &= ~TUNNEL_ENCAP_FLAG_REMCSUM;
                } else if (strcmp(*argv, "external") == 0) {
                        metadata = 1;
+               } else if (strcmp(*argv, "noexternal") == 0) {
+                       metadata = 0;
                } else if (strcmp(*argv, "ignore-df") == 0) {
                        ignore_df = 1;
                } else if (strcmp(*argv, "noignore-df") == 0) {
diff --git a/ip/link_ip6tnl.c b/ip/link_ip6tnl.c
index 84205b1..9efe8a1 100644
--- a/ip/link_ip6tnl.c
+++ b/ip/link_ip6tnl.c
@@ -50,7 +50,7 @@ static void print_usage(FILE *f)
                "                  [ [no]encap-csum ]\n"
                "                  [ [no]encap-csum6 ]\n"
                "                  [ [no]encap-remcsum ]\n"
-               "                  [ external ]\n"
+               "                  [ [no]external ]\n"
                "\n"
                "Where: ADDR      := IPV6_ADDRESS\n"
                "       ELIM      := { none | 0..255 }(default=%d)\n"
@@ -304,6 +304,8 @@ get_failed:
                        encapflags &= ~TUNNEL_ENCAP_FLAG_REMCSUM;
                } else if (strcmp(*argv, "external") == 0) {
                        metadata = 1;
+               } else if (strcmp(*argv, "noexternal") == 0) {
+                       metadata = 0;
                } else
                        usage();
                argc--, argv++;
diff --git a/ip/link_iptnl.c b/ip/link_iptnl.c
index 8a8f5dd..6a76721 100644
--- a/ip/link_iptnl.c
+++ b/ip/link_iptnl.c
@@ -53,7 +53,7 @@ static void print_usage(FILE *f, int sit)
        } else {
                fprintf(f, "          [ mode { ipip | mplsip | any } ]\n");
        }
-       fprintf(f, "                [ external ]\n");
+       fprintf(f, "                [ [no]external ]\n");
        fprintf(f, "                [ fwmark MARK ]\n");
        fprintf(f, "\n");
        fprintf(f, "Where: ADDR := { IP_ADDRESS | any }\n");
@@ -299,6 +299,8 @@ get_failed:
                        encapflags &= ~TUNNEL_ENCAP_FLAG_REMCSUM;
                } else if (strcmp(*argv, "external") == 0) {
                        metadata = 1;
+               } else if (strcmp(*argv, "noexternal") == 0) {
+                       metadata = 0;
                } else if (strcmp(*argv, "6rd-prefix") == 0) {
                        inet_prefix prefix;
 
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index 94ecbec..d7aa45d 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -698,6 +698,8 @@ the following additional arguments are supported:
 .I " mode " { ip6ip | ipip | mplsip | any } "
 ] [
 .BR erspan " \fIIDX "
+] [
+.RB [ no ] external
 ]
 
 .in +8
@@ -749,6 +751,10 @@ IPv6-Over-IPv4 is not supported for IPIP.
 indicates a 20 bit index/port number associated with the ERSPAN
 traffic's source port and direction.
 
+.sp
+.RB [ no ] external
+- make this tunnel externally controlled (or not, which is the default).
+
 .in -8
 
 .TP
-- 
1.7.10.4

Reply via email to