summaryrefslogtreecommitdiffstats
path: root/tc/q_tbf.c
diff options
context:
space:
mode:
Diffstat (limited to 'tc/q_tbf.c')
-rw-r--r--tc/q_tbf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tc/q_tbf.c b/tc/q_tbf.c
index 8f8c2776..d251435e 100644
--- a/tc/q_tbf.c
+++ b/tc/q_tbf.c
@@ -187,13 +187,13 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
opt.peakrate.mpu = mpu;
}
- tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
+ tail = NLMSG_TAIL(n);
addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
addattr_l(n, 2024, TCA_TBF_PARMS, &opt, sizeof(opt));
addattr_l(n, 3024, TCA_TBF_RTAB, rtab, 1024);
if (opt.peakrate.rate)
addattr_l(n, 4096, TCA_TBF_PTAB, ptab, 1024);
- tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
+ tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
return 0;
}