]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/q_red.c
treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes
[mirror_iproute2.git] / tc / q_red.c
index 40ba7c3e07c174a61dd0780e021fddad914d25a3..49fd4ac8051309189526a48d5c008a83687bfa90 100644 (file)
@@ -148,13 +148,12 @@ static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv,
        }
        opt.Scell_log = parm;
 
-       tail = NLMSG_TAIL(n);
-       addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
+       tail = addattr_nest(n, 1024, TCA_OPTIONS);
        addattr_l(n, 1024, TCA_RED_PARMS, &opt, sizeof(opt));
        addattr_l(n, 1024, TCA_RED_STAB, sbuf, 256);
        max_P = probability * pow(2, 32);
        addattr_l(n, 1024, TCA_RED_MAX_P, &max_P, sizeof(max_P));
-       tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
+       addattr_nest_end(n, tail);
        return 0;
 }