Use NLMSG_TAIL

(Logical change 1.127)
This commit is contained in:
5!tgraf 2005-01-18 01:24:18 +00:00
parent 370d67ba56
commit 034102f258
2 changed files with 6 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;
}