summaryrefslogtreecommitdiffstats
path: root/tc/m_nat.c
diff options
context:
space:
mode:
authorSerhey Popovych <serhe.popovych@gmail.com>2018-01-31 10:15:08 +0200
committerDavid Ahern <dsahern@gmail.com>2018-02-02 15:01:09 -0800
commitc14f9d92eee107fb9392ea262734cf430de5b571 (patch)
tree57073071c3667d424c2060a40ddc93a0501b8890 /tc/m_nat.c
parent28254695d1f33ed45f7e5dfe3bffe9f94bf6ab18 (diff)
treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes
We have helper routines to support nested attribute addition into netlink buffer: use them instead of open coding. Use addattr_nest_compat()/addattr_nest_compat_end() where appropriate. Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com> Signed-off-by: David Ahern <dsahern@gmail.com>
Diffstat (limited to 'tc/m_nat.c')
-rw-r--r--tc/m_nat.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tc/m_nat.c b/tc/m_nat.c
index f5de4d4c..1bb6495b 100644
--- a/tc/m_nat.c
+++ b/tc/m_nat.c
@@ -129,10 +129,9 @@ parse_nat(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct
}
}
- tail = NLMSG_TAIL(n);
- addattr_l(n, MAX_MSG, tca_id, NULL, 0);
+ tail = addattr_nest(n, MAX_MSG, tca_id);
addattr_l(n, MAX_MSG, TCA_NAT_PARMS, &sel, sizeof(sel));
- tail->rta_len = (char *)NLMSG_TAIL(n) - (char *)tail;
+ addattr_nest_end(n, tail);
*argc_p = argc;
*argv_p = argv;