]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
tc: parse attributes with NLA_F_NESTED flag
authorLeslie Monis <lesliemonis@gmail.com>
Thu, 16 Jan 2020 15:57:01 +0000 (21:27 +0530)
committerDavid Ahern <dsahern@gmail.com>
Wed, 22 Jan 2020 03:45:48 +0000 (03:45 +0000)
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>
tc/tc_class.c
tc/tc_filter.c
tc/tc_qdisc.c

index c7e3cfdf6c87644783c184ad43cde2a9e23b7a92..39bea9712dda7bcb5c8724081a31b72a261e8e48 100644 (file)
@@ -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");
index dcddca77ef1b0a460ebcca8b16e1d115f338c260..c591a19f31234c49470db3b03acd6235b75baac2 100644 (file)
@@ -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 ||
index 75a146721c403dc38ccbac8de8d2c918f5500bca..181fe2f0403f5bc5b3f2c009a5912f550c9d0d7c 100644 (file)
@@ -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;