diff options
Diffstat (limited to 'src/set_elem.c')
-rw-r--r-- | src/set_elem.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/set_elem.c b/src/set_elem.c index 1eddce2..a56fcb2 100644 --- a/src/set_elem.c +++ b/src/set_elem.c @@ -205,6 +205,8 @@ void nft_set_elems_nlmsg_build_payload(struct nlmsghdr *nlh, struct nft_set *s) if (s->flags & (1 << NFT_SET_ATTR_NAME)) mnl_attr_put_strz(nlh, NFTA_SET_ELEM_LIST_SET, s->name); + if (s->flags & (1 << NFT_SET_ATTR_ID)) + mnl_attr_put_u32(nlh, NFTA_SET_ELEM_LIST_SET_ID, htonl(s->id)); if (s->flags & (1 << NFT_SET_ATTR_TABLE)) mnl_attr_put_strz(nlh, NFTA_SET_ELEM_LIST_TABLE, s->table); @@ -361,6 +363,10 @@ int nft_set_elems_nlmsg_parse(const struct nlmsghdr *nlh, struct nft_set *s) strdup(mnl_attr_get_str(tb[NFTA_SET_ELEM_LIST_SET])); s->flags |= (1 << NFT_SET_ATTR_NAME); } + if (tb[NFTA_SET_ELEM_LIST_SET_ID]) { + s->id = ntohl(mnl_attr_get_u32(tb[NFTA_SET_ELEM_LIST_SET_ID])); + s->flags |= (1 << NFT_SET_ATTR_ID); + } if (tb[NFTA_SET_ELEM_LIST_ELEMENTS]) ret = nft_set_elems_parse(s, tb[NFTA_SET_ELEM_LIST_ELEMENTS]); |