Use NLMSG_TAIL
(Logical change 1.127)
diff --git a/tc/f_rsvp.c b/tc/f_rsvp.c
index 3f33696..8faa22e 100644
--- a/tc/f_rsvp.c
+++ b/tc/f_rsvp.c
@@ -189,7 +189,7 @@
if (argc == 0)
return 0;
- tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
+ tail = NLMSG_TAIL(n);
addattr_l(n, 4096, TCA_OPTIONS, NULL, 0);
while (argc > 0) {
@@ -282,7 +282,7 @@
if (pinfo_ok)
addattr_l(n, 4096, TCA_RSVP_PINFO, &pinfo, sizeof(pinfo));
- tail->rta_len = (((void*)n)+n->nlmsg_len) - (void*)tail;
+ tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
return 0;
}