naccyde / rpms / iproute

Forked from rpms/iproute 7 months ago
Clone

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

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