From 3566189cb6f01c4f2340734f432e20cb6ed1a999 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Tue, 15 Jun 2010 15:08:55 +0200 Subject: 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. --- lib/session.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'lib/session.c') 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; } -- cgit v1.2.3