]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/f_tcindex.c
treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes
[mirror_iproute2.git] / tc / f_tcindex.c
index 749273dbd9abb4c3cfe0838a73f392ac7d58763e..159cf41461b5b35c02a415a384668dafc78f7a47 100644 (file)
@@ -37,8 +37,7 @@ static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
                }
        }
        if (!argc) return 0;
-       tail = NLMSG_TAIL(n);
-       addattr_l(n, 4096, TCA_OPTIONS, NULL, 0);
+       tail = addattr_nest(n, 4096, TCA_OPTIONS);
        while (argc) {
                if (!strcmp(*argv, "hash")) {
                        int hash;
@@ -113,7 +112,7 @@ static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
                argc--;
                argv++;
        }
-       tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
+       addattr_nest_end(n, tail);
        return 0;
 }