* 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;
}
# Static: List set
0 ipset -L test > .foo0 && ./sort.sh .foo0
# Static: Check listing
-0 diff .foo iptree.t.list0 && rm .foo
+0 diff -I 'Size in memory.*' .foo iptree.t.list0 && rm .foo
# Static: Flush test set
0 ipset -F test
# Static: Delete test set
# List set
0 ipset -L test > .foo0 && ./sort.sh .foo0
# Check listing
-0 diff .foo iptreemap.t.list0 && rm .foo
+0 diff -I 'Size in memory.*' .foo iptreemap.t.list0 && rm .foo
# Flush test set
0 ipset -F test
# Delete test set