summaryrefslogtreecommitdiffstats
path: root/src/netlink.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-03-30 13:25:10 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2016-03-30 13:29:08 +0200
commit5db9dc9292d30a3672b691e4a8a6cd49daa47b71 (patch)
tree7de2873260087f51c76943e6febb0efa34d388ed /src/netlink.c
parent89e3001be44aa2f25e51b139f044328230cbb098 (diff)
src: store parser location for handle and position specifiers
Store the parser location structure for handle and position IDs so we can use this information from the evaluation step, to provide better error reporting. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Acked-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Diffstat (limited to 'src/netlink.c')
-rw-r--r--src/netlink.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/netlink.c b/src/netlink.c
index ba0c20a0..e3ba2ed3 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -143,8 +143,8 @@ struct nftnl_chain *alloc_nftnl_chain(const struct handle *h)
nftnl_chain_set_u32(nlc, NFTNL_CHAIN_FAMILY, h->family);
nftnl_chain_set_str(nlc, NFTNL_CHAIN_TABLE, h->table);
- if (h->handle != 0)
- nftnl_chain_set_u64(nlc, NFTNL_CHAIN_HANDLE, h->handle);
+ if (h->handle.id != 0)
+ nftnl_chain_set_u64(nlc, NFTNL_CHAIN_HANDLE, h->handle.id);
if (h->chain != NULL)
nftnl_chain_set_str(nlc, NFTNL_CHAIN_NAME, h->chain);
@@ -163,10 +163,10 @@ struct nftnl_rule *alloc_nftnl_rule(const struct handle *h)
nftnl_rule_set_str(nlr, NFTNL_RULE_TABLE, h->table);
if (h->chain != NULL)
nftnl_rule_set_str(nlr, NFTNL_RULE_CHAIN, h->chain);
- if (h->handle)
- nftnl_rule_set_u64(nlr, NFTNL_RULE_HANDLE, h->handle);
- if (h->position)
- nftnl_rule_set_u64(nlr, NFTNL_RULE_POSITION, h->position);
+ if (h->handle.id)
+ nftnl_rule_set_u64(nlr, NFTNL_RULE_HANDLE, h->handle.id);
+ if (h->position.id)
+ nftnl_rule_set_u64(nlr, NFTNL_RULE_POSITION, h->position.id);
return nlr;
}
@@ -700,7 +700,7 @@ static struct chain *netlink_delinearize_chain(struct netlink_ctx *ctx,
nftnl_chain_get_u32(nlc, NFTNL_CHAIN_FAMILY);
chain->handle.table =
xstrdup(nftnl_chain_get_str(nlc, NFTNL_CHAIN_TABLE));
- chain->handle.handle =
+ chain->handle.handle.id =
nftnl_chain_get_u64(nlc, NFTNL_CHAIN_HANDLE);
if (nftnl_chain_is_set(nlc, NFTNL_CHAIN_HOOKNUM) &&