naccyde / rpms / iproute

Forked from rpms/iproute 8 months ago
Clone

Blame SOURCES/0005-m_mpls-test-the-mac_push-action-after-modify.patch

2f28bf
From 8c66f562e88887d2bf1c1064117496c4cb862b11 Mon Sep 17 00:00:00 2001
2f28bf
Message-Id: <8c66f562e88887d2bf1c1064117496c4cb862b11.1611877215.git.aclaudi@redhat.com>
2f28bf
In-Reply-To: <cb7ce51cc1abd7b98370b903ec96205ebfe48661.1611877215.git.aclaudi@redhat.com>
2f28bf
References: <cb7ce51cc1abd7b98370b903ec96205ebfe48661.1611877215.git.aclaudi@redhat.com>
2f28bf
From: Andrea Claudi <aclaudi@redhat.com>
2f28bf
Date: Fri, 29 Jan 2021 00:35:03 +0100
2f28bf
Subject: [PATCH] m_mpls: test the 'mac_push' action after 'modify'
2f28bf
2f28bf
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1885770
2f28bf
Upstream Status: unknown commit f1298d76
2f28bf
2f28bf
commit f1298d76606a581cf3ab9ec45a92b41e72a6b4f0
2f28bf
Author: Guillaume Nault <gnault@redhat.com>
2f28bf
Date:   Thu Oct 22 11:11:44 2020 +0200
2f28bf
2f28bf
    m_mpls: test the 'mac_push' action after 'modify'
2f28bf
2f28bf
    Commit 02a261b5ba1c ("m_mpls: add mac_push action") added a matches()
2f28bf
    test for the "mac_push" string before the test for "modify".
2f28bf
    This changes the previous behaviour as 'action m' used to match
2f28bf
    "modify" while it now matches "mac_push".
2f28bf
2f28bf
    Revert to the original behaviour by moving the "mac_push" test after
2f28bf
    "modify".
2f28bf
2f28bf
    Fixes: 02a261b5ba1c ("m_mpls: add mac_push action")
2f28bf
    Signed-off-by: Guillaume Nault <gnault@redhat.com>
2f28bf
    Signed-off-by: David Ahern <dsahern@gmail.com>
2f28bf
---
2f28bf
 tc/m_mpls.c | 8 ++++----
2f28bf
 1 file changed, 4 insertions(+), 4 deletions(-)
2f28bf
2f28bf
diff --git a/tc/m_mpls.c b/tc/m_mpls.c
2f28bf
index cb8019b1..2c3752ba 100644
2f28bf
--- a/tc/m_mpls.c
2f28bf
+++ b/tc/m_mpls.c
2f28bf
@@ -99,14 +99,14 @@ static int parse_mpls(struct action_util *a, int *argc_p, char ***argv_p,
2f28bf
 			if (check_double_action(action, *argv))
2f28bf
 				return -1;
2f28bf
 			action = TCA_MPLS_ACT_PUSH;
2f28bf
-		} else if (matches(*argv, "mac_push") == 0) {
2f28bf
-			if (check_double_action(action, *argv))
2f28bf
-				return -1;
2f28bf
-			action = TCA_MPLS_ACT_MAC_PUSH;
2f28bf
 		} else if (matches(*argv, "modify") == 0) {
2f28bf
 			if (check_double_action(action, *argv))
2f28bf
 				return -1;
2f28bf
 			action = TCA_MPLS_ACT_MODIFY;
2f28bf
+		} else if (matches(*argv, "mac_push") == 0) {
2f28bf
+			if (check_double_action(action, *argv))
2f28bf
+				return -1;
2f28bf
+			action = TCA_MPLS_ACT_MAC_PUSH;
2f28bf
 		} else if (matches(*argv, "dec_ttl") == 0) {
2f28bf
 			if (check_double_action(action, *argv))
2f28bf
 				return -1;
2f28bf
-- 
2f28bf
2.29.2
2f28bf