Blame SOURCES/0045-tc-m_tunnel_key-Allow-key-less-tunnels.patch

99be8f
From f43f500151a6261e24d89674b0a44f2d84c9e207 Mon Sep 17 00:00:00 2001
99be8f
From: Phil Sutter <psutter@redhat.com>
99be8f
Date: Wed, 6 Feb 2019 14:21:09 +0100
99be8f
Subject: [PATCH] tc: m_tunnel_key: Allow key-less tunnels
99be8f
99be8f
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1658506
99be8f
Upstream Status: iproute2.git commit dc0332b1e8e4a
99be8f
Conflicts: Context change due to missing commit 59eb271d1d259
99be8f
           ("tc: m_tunnel_key: add csum/nocsum option").
99be8f
99be8f
commit dc0332b1e8e4ab8771562128993d512986f856e2
99be8f
Author: Adi Nissim <adin@mellanox.com>
99be8f
Date:   Thu Jan 10 15:03:50 2019 +0200
99be8f
99be8f
    tc: m_tunnel_key: Allow key-less tunnels
99be8f
99be8f
    Change the id parameter of the tunnel_key set action from mandatory to
99be8f
    optional.
99be8f
99be8f
    Some tunneling protocols (e.g. GRE) specify the id as an optional field.
99be8f
99be8f
    Signed-off-by: Adi Nissim <adin@mellanox.com>
99be8f
    Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
99be8f
---
99be8f
 man/man8/tc-tunnel_key.8 | 4 ++--
99be8f
 tc/m_tunnel_key.c        | 6 ++----
99be8f
 2 files changed, 4 insertions(+), 6 deletions(-)
99be8f
99be8f
diff --git a/man/man8/tc-tunnel_key.8 b/man/man8/tc-tunnel_key.8
99be8f
index 2e56973..52fa585 100644
99be8f
--- a/man/man8/tc-tunnel_key.8
99be8f
+++ b/man/man8/tc-tunnel_key.8
99be8f
@@ -56,12 +56,12 @@ above).
99be8f
 .TP
99be8f
 .B set
99be8f
 Set tunnel metadata to be used by the IP tunnel device. Requires
99be8f
-.B id
99be8f
-,
99be8f
 .B src_ip
99be8f
 and
99be8f
 .B dst_ip
99be8f
 options.
99be8f
+.B id
99be8f
+,
99be8f
 .B dst_port
99be8f
 is optional.
99be8f
 .RS
99be8f
diff --git a/tc/m_tunnel_key.c b/tc/m_tunnel_key.c
99be8f
index 5222c25..acbcfc1 100644
99be8f
--- a/tc/m_tunnel_key.c
99be8f
+++ b/tc/m_tunnel_key.c
99be8f
@@ -25,7 +25,7 @@ static void explain(void)
99be8f
 	fprintf(stderr, "       tunnel_key set <TUNNEL_KEY>\n");
99be8f
 	fprintf(stderr,
99be8f
 		"Where TUNNEL_KEY is a combination of:\n"
99be8f
-		"id <TUNNELID> (mandatory)\n"
99be8f
+		"id <TUNNELID>\n"
99be8f
 		"src_ip <IP> (mandatory)\n"
99be8f
 		"dst_ip <IP> (mandatory)\n"
99be8f
 		"dst_port <UDP_PORT>\n");
99be8f
@@ -91,7 +91,6 @@ static int parse_tunnel_key(struct action_util *a, int *argc_p, char ***argv_p,
99be8f
 	int ret;
99be8f
 	int has_src_ip = 0;
99be8f
 	int has_dst_ip = 0;
99be8f
-	int has_key_id = 0;
99be8f
 
99be8f
 	if (matches(*argv, "tunnel_key") != 0)
99be8f
 		return -1;
99be8f
@@ -147,7 +146,6 @@ static int parse_tunnel_key(struct action_util *a, int *argc_p, char ***argv_p,
99be8f
 				fprintf(stderr, "Illegal \"id\"\n");
99be8f
 				return -1;
99be8f
 			}
99be8f
-			has_key_id = 1;
99be8f
 		} else if (matches(*argv, "dst_port") == 0) {
99be8f
 			NEXT_ARG();
99be8f
 			ret = tunnel_key_parse_dst_port(*argv,
99be8f
@@ -180,7 +178,7 @@ static int parse_tunnel_key(struct action_util *a, int *argc_p, char ***argv_p,
99be8f
 	}
99be8f
 
99be8f
 	if (action == TCA_TUNNEL_KEY_ACT_SET &&
99be8f
-	    (!has_src_ip || !has_dst_ip || !has_key_id)) {
99be8f
+	    (!has_src_ip || !has_dst_ip)) {
99be8f
 		fprintf(stderr, "set needs tunnel_key parameters\n");
99be8f
 		explain();
99be8f
 		return -1;
99be8f
-- 
99be8f
1.8.3.1
99be8f