diff options
author | Leslie Monis <lesliemonis@gmail.com> | 2020-01-16 21:27:01 +0530 |
---|---|---|
committer | David Ahern <dsahern@gmail.com> | 2020-01-22 03:45:48 +0000 |
commit | eae5f4b5c88eb60465d8b70c52efff57039d0024 (patch) | |
tree | 859013b0008e0e87f3c460f8c594752df2b14acb | |
parent | 22aec42679d57b8e0aef864c4d45feadb727c3ce (diff) | |
download | iproute2-eae5f4b5c88eb60465d8b70c52efff57039d0024.tar.gz |
tc: parse attributes with NLA_F_NESTED flag
The kernel now requires all new nested attributes to set the
NLA_F_NESTED flag. Enable tc {qdisc,class,filter} to parse
attributes that have the NLA_F_NESTED flag set.
Signed-off-by: Leslie Monis <lesliemonis@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
-rw-r--r-- | tc/tc_class.c | 6 | ||||
-rw-r--r-- | tc/tc_filter.c | 2 | ||||
-rw-r--r-- | tc/tc_qdisc.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/tc/tc_class.c b/tc/tc_class.c index c7e3cfdf6..39bea9712 100644 --- a/tc/tc_class.c +++ b/tc/tc_class.c @@ -246,8 +246,8 @@ static void graph_cls_show(FILE *fp, char *buf, struct hlist_head *root_list, "+---(%s)", cls_id_str); strcat(buf, str); - parse_rtattr(tb, TCA_MAX, (struct rtattr *)cls->data, - cls->data_len); + parse_rtattr_flags(tb, TCA_MAX, (struct rtattr *)cls->data, + cls->data_len, NLA_F_NESTED); if (tb[TCA_KIND] == NULL) { strcat(buf, " [unknown qdisc kind] "); @@ -327,7 +327,7 @@ int print_class(struct nlmsghdr *n, void *arg) if (filter_classid && t->tcm_handle != filter_classid) return 0; - parse_rtattr(tb, TCA_MAX, TCA_RTA(t), len); + parse_rtattr_flags(tb, TCA_MAX, TCA_RTA(t), len, NLA_F_NESTED); if (tb[TCA_KIND] == NULL) { fprintf(stderr, "print_class: NULL kind\n"); diff --git a/tc/tc_filter.c b/tc/tc_filter.c index dcddca77e..c591a19f3 100644 --- a/tc/tc_filter.c +++ b/tc/tc_filter.c @@ -267,7 +267,7 @@ int print_filter(struct nlmsghdr *n, void *arg) return -1; } - parse_rtattr(tb, TCA_MAX, TCA_RTA(t), len); + parse_rtattr_flags(tb, TCA_MAX, TCA_RTA(t), len, NLA_F_NESTED); if (tb[TCA_KIND] == NULL && (n->nlmsg_type == RTM_NEWTFILTER || n->nlmsg_type == RTM_GETTFILTER || diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c index 75a146721..181fe2f04 100644 --- a/tc/tc_qdisc.c +++ b/tc/tc_qdisc.c @@ -235,7 +235,7 @@ int print_qdisc(struct nlmsghdr *n, void *arg) if (filter_ifindex && filter_ifindex != t->tcm_ifindex) return 0; - parse_rtattr(tb, TCA_MAX, TCA_RTA(t), len); + parse_rtattr_flags(tb, TCA_MAX, TCA_RTA(t), len, NLA_F_NESTED); if (tb[TCA_KIND] == NULL) { fprintf(stderr, "print_qdisc: NULL kind\n"); @@ -461,7 +461,7 @@ static int tc_qdisc_block_exists_cb(struct nlmsghdr *n, void *arg) if (len < 0) return -1; - parse_rtattr(tb, TCA_MAX, TCA_RTA(t), len); + parse_rtattr_flags(tb, TCA_MAX, TCA_RTA(t), len, NLA_F_NESTED); if (tb[TCA_KIND] == NULL) return -1; |