Commit 1a1d22a7 authored by 17!tgraf's avatar 17!tgraf

Use NLMSG_TAIL

(Logical change 1.127)
parent 95cd9a07
...@@ -213,7 +213,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, ...@@ -213,7 +213,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
argc--; argv++; argc--; argv++;
} }
tail = (struct rtattr*)(((void*)n) + NLMSG_ALIGN(n->nlmsg_len)); tail = NLMSG_TAIL(n);
addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt));
addattr_l(n, 1024, TCA_NETEM_CORR, &cor, sizeof(cor)); addattr_l(n, 1024, TCA_NETEM_CORR, &cor, sizeof(cor));
...@@ -222,7 +222,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, ...@@ -222,7 +222,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
addattr_l(n, 32768, TCA_NETEM_DELAY_DIST, addattr_l(n, 32768, TCA_NETEM_DELAY_DIST,
dist_data, dist_size*sizeof(dist_data[0])); dist_data, dist_size*sizeof(dist_data[0]));
} }
tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail; tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
return 0; 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