summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2010-06-15 15:08:55 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2010-06-15 15:08:55 +0200
commit3566189cb6f01c4f2340734f432e20cb6ed1a999 (patch)
treea4114a80245cf51a1390baf14ff0537e8fbe2594 /lib
parent3fd6b24ace319b139ec3c4e3031a5f05d21e304e (diff)
Use libmnl nest functions and fix size differences in iptree*.t
Use the libmnl mnl_attr_nest_star/mnl_attr_nest_end functions instead of the private ones. Ignore possible size differences in iptree*.t compatibility tests.
Diffstat (limited to 'lib')
-rw-r--r--lib/session.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/lib/session.c b/lib/session.c
index 2c85468..64d5c4a 100644
--- a/lib/session.c
+++ b/lib/session.c
@@ -1248,36 +1248,16 @@ callback_noop(const struct nlmsghdr *nlh UNUSED, void *data UNUSED)
* Build and send messages
*/
-static inline struct nlattr *
-nla_nest_start(struct nlmsghdr *nlh, int attr)
-{
- struct nlattr *start = mnl_nlmsg_get_payload_tail(nlh);
-
- start->nla_type = attr | NLA_F_NESTED;
- start->nla_len = MNL_ALIGN(sizeof(struct nlattr));
-
- nlh->nlmsg_len += start->nla_len;
-
- return start;
-}
-
-static inline void
-nla_nest_end(struct nlmsghdr *nlh, struct nlattr *start)
-{
- start->nla_len = (void *) mnl_nlmsg_get_payload_tail(nlh)
- - (void *) start;
-}
-
static inline void
open_nested(struct ipset_session *session, struct nlmsghdr *nlh, int attr)
{
- session->nested[session->nestid++] = nla_nest_start(nlh, attr);
+ session->nested[session->nestid++] = mnl_attr_nest_start(nlh, attr);
}
static inline void
close_nested(struct ipset_session *session, struct nlmsghdr *nlh)
{
- nla_nest_end(nlh, session->nested[session->nestid-1]);
+ mnl_attr_nest_end(nlh, session->nested[session->nestid-1]);
session->nested[--session->nestid] = NULL;
}