Blame SOURCES/0125-tc-flower-No-need-to-cache-indev-arg.patch

99be8f
From 85bcdf3ca3a76ce3b4f62769aa64adcb1c849082 Mon Sep 17 00:00:00 2001
99be8f
From: Andrea Claudi <aclaudi@redhat.com>
99be8f
Date: Mon, 29 Apr 2019 20:09:13 +0200
99be8f
Subject: [PATCH] tc: flower: No need to cache indev arg
99be8f
99be8f
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
99be8f
Upstream Status: iproute2.git commit ee474849c8511
99be8f
99be8f
commit ee474849c85116ec36e387882447f737ac3fdefb
99be8f
Author: Phil Sutter <phil@nwl.cc>
99be8f
Date:   Mon Oct 2 13:46:36 2017 +0200
99be8f
99be8f
    tc: flower: No need to cache indev arg
99be8f
99be8f
    Since addattrstrz() will copy the provided string into the attribute
99be8f
    payload, there is no need to cache the data.
99be8f
99be8f
    Signed-off-by: Phil Sutter <phil@nwl.cc>
99be8f
---
99be8f
 tc/f_flower.c | 5 +----
99be8f
 1 file changed, 1 insertion(+), 4 deletions(-)
99be8f
99be8f
diff --git a/tc/f_flower.c b/tc/f_flower.c
99be8f
index e2c7daa0b8e03..34249254603ff 100644
99be8f
--- a/tc/f_flower.c
99be8f
+++ b/tc/f_flower.c
99be8f
@@ -642,11 +642,8 @@ static int flower_parse_opt(struct filter_util *qu, char *handle,
99be8f
 		} else if (matches(*argv, "skip_sw") == 0) {
99be8f
 			flags |= TCA_CLS_FLAGS_SKIP_SW;
99be8f
 		} else if (matches(*argv, "indev") == 0) {
99be8f
-			char ifname[IFNAMSIZ] = {};
99be8f
-
99be8f
 			NEXT_ARG();
99be8f
-			strncpy(ifname, *argv, sizeof(ifname) - 1);
99be8f
-			addattrstrz(n, MAX_MSG, TCA_FLOWER_INDEV, ifname);
99be8f
+			addattrstrz(n, MAX_MSG, TCA_FLOWER_INDEV, *argv);
99be8f
 		} else if (matches(*argv, "vlan_id") == 0) {
99be8f
 			__u16 vid;
99be8f
 
99be8f
-- 
99be8f
2.20.1
99be8f