Use NLMSG_TAIL
(Logical change 1.127)
diff --git a/tc/q_tbf.c b/tc/q_tbf.c
index 8f8c277..d251435 100644
--- a/tc/q_tbf.c
+++ b/tc/q_tbf.c
@@ -187,13 +187,13 @@
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;
}