tc: flower: No need to cache indev arg

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>
This commit is contained in:
Phil Sutter 2017-10-02 13:46:36 +02:00 committed by Stephen Hemminger
parent 26111ab1db
commit ee474849c8
1 changed files with 1 additions and 4 deletions

View File

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