summaryrefslogtreecommitdiffstats
path: root/tc
diff options
context:
space:
mode:
author5!tgraf <5!tgraf>2005-01-18 01:24:18 +0000
committer5!tgraf <5!tgraf>2005-01-18 01:24:18 +0000
commit034102f2589b79e92ff677dc74a54096ef10d99d (patch)
tree9cf443f5bd1f2e4adcd2cd1ed923177e3821f032 /tc
parent370d67ba5678b222ccbdd19647ae81ccc3c97801 (diff)
Use NLMSG_TAIL
(Logical change 1.127)
Diffstat (limited to 'tc')
-rw-r--r--tc/f_fw.c4
-rw-r--r--tc/q_cbq.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/tc/f_fw.c b/tc/f_fw.c
index 64084bbf..b8134be4 100644
--- a/tc/f_fw.c
+++ b/tc/f_fw.c
@@ -50,7 +50,7 @@ static int fw_parse_opt(struct filter_util *qu, char *handle, int argc, char **a
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) {
@@ -98,7 +98,7 @@ static int fw_parse_opt(struct filter_util *qu, char *handle, int argc, char **a
}
argc--; argv++;
}
- tail->rta_len = (((void*)n)+n->nlmsg_len) - (void*)tail;
+ tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
return 0;
}
diff --git a/tc/q_cbq.c b/tc/q_cbq.c
index 82a69ee2..3a10175d 100644
--- a/tc/q_cbq.c
+++ b/tc/q_cbq.c
@@ -151,7 +151,7 @@ static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
lss.change = TCF_CBQ_LSS_MAXIDLE|TCF_CBQ_LSS_EWMA|TCF_CBQ_LSS_AVPKT;
lss.avpkt = avpkt;
- 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, 1024, TCA_CBQ_RATE, &r, sizeof(r));
addattr_l(n, 1024, TCA_CBQ_LSSOPT, &lss, sizeof(lss));
@@ -162,7 +162,7 @@ static int cbq_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
printf("%u ", rtab[i]);
printf("\n");
}
- tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
+ tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
return 0;
}
@@ -385,7 +385,7 @@ static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
lss.change |= TCF_CBQ_LSS_EWMA;
}
- tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
+ tail = NLMSG_TAIL(n);
addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
if (lss.change) {
lss.change |= TCF_CBQ_LSS_FLAGS;
@@ -405,7 +405,7 @@ static int cbq_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
printf("\n");
}
}
- tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
+ tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
return 0;
}