summaryrefslogtreecommitdiffstats
path: root/tc
diff options
context:
space:
mode:
author2!tgraf <2!tgraf>2005-01-18 01:24:18 +0000
committer2!tgraf <2!tgraf>2005-01-18 01:24:18 +0000
commitfc78a8e98dcb8efad64b06dc65716d97fc99b307 (patch)
treea58347e257c4e9c74efe8e091f39791b365c3d7a /tc
parent1a1d22a72284acf43f7aff5210db018076e66194 (diff)
Use NLMSG_TAIL
(Logical change 1.127)
Diffstat (limited to 'tc')
-rw-r--r--tc/m_ipt.c5
-rw-r--r--tc/m_pedit.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/tc/m_ipt.c b/tc/m_ipt.c
index 24f3979c..ec33f8fe 100644
--- a/tc/m_ipt.c
+++ b/tc/m_ipt.c
@@ -547,7 +547,7 @@ static int parse_ipt(struct action_util *a,int *argc_p,
}
}
- tail = (struct rtattr *) (((void *) n) + NLMSG_ALIGN(n->nlmsg_len));
+ tail = NLMSG_TAIL(n);
addattr_l(n, MAX_MSG, tca_id, NULL, 0);
fprintf(stdout, "tablename: %s hook: %s\n ", tname, ipthooks[hook]);
fprintf(stdout, "\ttarget: ");
@@ -569,8 +569,7 @@ static int parse_ipt(struct action_util *a,int *argc_p,
addattr_l(n, MAX_MSG, TCA_IPT_INDEX, &index, 4);
if (m)
addattr_l(n, MAX_MSG, TCA_IPT_TARG, m->t, m->t->u.target_size);
- tail->rta_len =
- (((void *) n) + NLMSG_ALIGN(n->nlmsg_len)) - (void *) tail;
+ tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
argc -= optind;
argv += optind;
diff --git a/tc/m_pedit.c b/tc/m_pedit.c
index f3cec6fe..8d7a60b0 100644
--- a/tc/m_pedit.c
+++ b/tc/m_pedit.c
@@ -534,11 +534,10 @@ parse_pedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, stru
}
}
- tail = (struct rtattr *) (((void *) n) + NLMSG_ALIGN(n->nlmsg_len));
+ tail = NLMSG_TAIL(n);
addattr_l(n, MAX_MSG, tca_id, NULL, 0);
addattr_l(n, MAX_MSG, TCA_PEDIT_PARMS,&sel, sizeof(sel.sel)+sel.sel.nkeys*sizeof(struct tc_pedit_key));
- tail->rta_len =
- (((void *) n) + NLMSG_ALIGN(n->nlmsg_len)) - (void *) tail;
+ tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
*argc_p = argc;
*argv_p = argv;