summaryrefslogtreecommitdiffstats
path: root/src/netlink_linearize.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_linearize.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_linearize.c')
-rw-r--r--src/netlink_linearize.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c
index c9af0365..7c6ef165 100644
--- a/src/netlink_linearize.c
+++ b/src/netlink_linearize.c
@@ -1030,5 +1030,9 @@ void netlink_linearize_rule(struct netlink_ctx *ctx, struct nftnl_rule *nlr,
list_for_each_entry(stmt, &rule->stmts, list)
netlink_gen_stmt(&lctx, stmt);
+ if (rule->comment)
+ nftnl_rule_set_data(nlr, NFTNL_RULE_USERDATA,
+ rule->comment, strlen(rule->comment) + 1);
+
netlink_dump_rule(nlr);
}