path: root/src/netlink_linearize.c
diff options
authorPablo Neira Ayuso <>2014-08-18 17:43:28 +0200
committerPablo Neira Ayuso <>2014-08-19 21:37:40 +0200
commit838915373efe11e388e57703e9733e42f42bd5da (patch)
treebfceea443c8bd3b8c4352c2ed3379db0a485c51a /src/netlink_linearize.c
parent17ab8231cf9ff2a64c186a8104138688291c0760 (diff)
src: don't return error in netlink_linearize_rule()
This function converts the rule from the list of statements to the netlink message format. The only two possible errors that can make this function to fail are memory exhaustion and malformed statements which inmediately stop the execution of nft. Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'src/netlink_linearize.c')
1 files changed, 2 insertions, 3 deletions
diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c
index f5ce19c9..5eecd791 100644
--- a/src/netlink_linearize.c
+++ b/src/netlink_linearize.c
@@ -746,8 +746,8 @@ static void netlink_gen_stmt(struct netlink_linearize_ctx *ctx,
-int netlink_linearize_rule(struct netlink_ctx *ctx, struct nft_rule *nlr,
- const struct rule *rule)
+void netlink_linearize_rule(struct netlink_ctx *ctx, struct nft_rule *nlr,
+ const struct rule *rule)
struct netlink_linearize_ctx lctx;
const struct stmt *stmt;
@@ -760,5 +760,4 @@ int netlink_linearize_rule(struct netlink_ctx *ctx, struct nft_rule *nlr,
netlink_gen_stmt(&lctx, stmt);
- return 0;