]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tc: flower: No need to cache indev arg
authorPhil Sutter <phil@nwl.cc>
Mon, 2 Oct 2017 11:46:36 +0000 (13:46 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 2 Oct 2017 15:01:21 +0000 (08:01 -0700)
Since addattrstrz() will copy the provided string into the attribute
payload, there is no need to cache the data.

Signed-off-by: Phil Sutter <phil@nwl.cc>
tc/f_flower.c

index 934832e2bbe90562a90f3e739bc15e66f0c8da5d..99e62a382dec65351f8fbcad34e7f25a62968d4c 100644 (file)
@@ -629,11 +629,8 @@ static int flower_parse_opt(struct filter_util *qu, char *handle,
                } else if (matches(*argv, "skip_sw") == 0) {
                        flags |= TCA_CLS_FLAGS_SKIP_SW;
                } else if (matches(*argv, "indev") == 0) {
-                       char ifname[IFNAMSIZ] = {};
-
                        NEXT_ARG();
-                       strncpy(ifname, *argv, sizeof(ifname) - 1);
-                       addattrstrz(n, MAX_MSG, TCA_FLOWER_INDEV, ifname);
+                       addattrstrz(n, MAX_MSG, TCA_FLOWER_INDEV, *argv);
                } else if (matches(*argv, "vlan_id") == 0) {
                        __u16 vid;