]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/m_simple.c
treewide: refactor help messages
[mirror_iproute2.git] / tc / m_simple.c
index a687b9f83f658b88ac23eaa86030b1ae1c113406..e3e1cdb1ba2108684a14d4cc49707b403717fb59 100644 (file)
@@ -80,8 +80,9 @@
 #endif
 static void explain(void)
 {
-       fprintf(stderr, "Usage:... simple [sdata STRING] [index INDEX] [CONTROL]\n");
-       fprintf(stderr, "\tSTRING being an arbitrary string\n"
+       fprintf(stderr,
+               "Usage:... simple [sdata STRING] [index INDEX] [CONTROL]\n"
+               "\tSTRING being an arbitrary string\n"
                "\tINDEX := optional index value used\n"
                "\tCONTROL := reclassify|pipe|drop|continue|ok\n");
 }
@@ -146,12 +147,11 @@ parse_simple(struct action_util *a, int *argc_p, char ***argv_p, int tca_id,
 
        sel.action = TC_ACT_PIPE;
 
-       tail = NLMSG_TAIL(n);
-       addattr_l(n, MAX_MSG, tca_id, NULL, 0);
+       tail = addattr_nest(n, MAX_MSG, tca_id);
        addattr_l(n, MAX_MSG, TCA_DEF_PARMS, &sel, sizeof(sel));
        if (simpdata)
                addattr_l(n, MAX_MSG, TCA_DEF_DATA, simpdata, SIMP_MAX_DATA);
-       tail->rta_len = (char *)NLMSG_TAIL(n) - (char *)tail;
+       addattr_nest_end(n, tail);
 
        *argc_p = argc;
        *argv_p = argv;