Commit 034102f2 authored by 5!tgraf's avatar 5!tgraf

Use NLMSG_TAIL

(Logical change 1.127)
parent 370d67ba
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment