diff --git a/tc/q_mqprio.c b/tc/q_mqprio.c index 207d6441..89b46002 100644 --- a/tc/q_mqprio.c +++ b/tc/q_mqprio.c @@ -173,7 +173,8 @@ static int mqprio_parse_opt(struct qdisc_util *qu, int argc, argc--; argv++; } - tail = addattr_nest_compat(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); + tail = NLMSG_TAIL(n); + addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); if (flags & TC_MQPRIO_F_MODE) addattr_l(n, 1024, TCA_MQPRIO_MODE, @@ -208,7 +209,7 @@ static int mqprio_parse_opt(struct qdisc_util *qu, int argc, addattr_nest_end(n, start); } - addattr_nest_compat_end(n, tail); + tail->rta_len = (void *)NLMSG_TAIL(n) - (void *)tail; return 0; } diff --git a/tc/q_netem.c b/tc/q_netem.c index 623ec903..9f9a9b3d 100644 --- a/tc/q_netem.c +++ b/tc/q_netem.c @@ -422,6 +422,8 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, } } + tail = NLMSG_TAIL(n); + if (reorder.probability) { if (opt.latency == 0) { fprintf(stderr, "reordering not possible without specifying some delay\n"); @@ -450,7 +452,8 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, return -1; } - tail = addattr_nest_compat(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); + if (addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)) < 0) + return -1; if (present[TCA_NETEM_CORR] && addattr_l(n, 1024, TCA_NETEM_CORR, &cor, sizeof(cor)) < 0) @@ -509,7 +512,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, return -1; free(dist_data); } - addattr_nest_compat_end(n, tail); + tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail; return 0; }