summaryrefslogtreecommitdiffstats
path: root/src/netlink_delinearize.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2015-11-15 16:10:45 +0000
committerPatrick McHardy <kaber@trash.net>2015-11-15 16:10:45 +0000
commitc552570dc67a56614c1053b9ea2fb27cd6ce106b (patch)
tree4fca6d4ed25a5abead43ec2890085d8e00b17ac1 /src/netlink_delinearize.c
parent2f16228172ff3629c09b7d0633e30c125aebc37e (diff)
rule: move comment out of handle
The comment does not belong to the handle, it belongs to the rule. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/netlink_delinearize.c')
-rw-r--r--src/netlink_delinearize.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index 3584de78..3499d748 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -1609,19 +1609,19 @@ struct rule *netlink_delinearize_rule(struct netlink_ctx *ctx,
if (nftnl_rule_is_set(nlr, NFTNL_RULE_POSITION))
h.position = nftnl_rule_get_u64(nlr, NFTNL_RULE_POSITION);
+ pctx->rule = rule_alloc(&netlink_location, &h);
+ pctx->table = table_lookup(&h);
+ assert(pctx->table != NULL);
+
if (nftnl_rule_is_set(nlr, NFTNL_RULE_USERDATA)) {
- uint32_t len;
const void *data;
+ uint32_t len;
- data = nftnl_rule_get_data(nlr, NFTNL_RULE_USERDATA,
- &len);
- h.comment = xmalloc(len);
- memcpy((char *)h.comment, data, len);
+ data = nftnl_rule_get_data(nlr, NFTNL_RULE_USERDATA, &len);
+ pctx->rule->comment = xmalloc(len);
+ memcpy((char *)pctx->rule->comment, data, len);
}
- pctx->rule = rule_alloc(&netlink_location, &h);
- pctx->table = table_lookup(&h);
- assert(pctx->table != NULL);
nftnl_expr_foreach((struct nftnl_rule *)nlr, netlink_parse_expr, pctx);
rule_parse_postprocess(pctx, pctx->rule);