diff mbox series

[nft,v2,1/5] rule: Use C99-style initializer in cache_init()

Message ID 20170928151745.28426-2-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show
Series Get output under application control | expand

Commit Message

Phil Sutter Sept. 28, 2017, 3:17 p.m. UTC
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 src/rule.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

Comments

Pablo Neira Ayuso Sept. 29, 2017, 10:25 a.m. UTC | #1
Applied, thanks Phil.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/src/rule.c b/src/rule.c
index 1e0558eaf0751..85505aecd5091 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -128,17 +128,16 @@  static int cache_init(struct mnl_socket *nf_sock, struct nft_cache *cache,
 	struct handle handle = {
 		.family = NFPROTO_UNSPEC,
 	};
-	struct netlink_ctx ctx;
+	struct netlink_ctx ctx = {
+		.list		= LIST_HEAD_INIT(ctx.list),
+		.nf_sock	= nf_sock,
+		.cache		= cache,
+		.msgs		= msgs,
+		.seqnum		= cache->seqnum++,
+		.debug_mask	= debug_mask,
+	};
 	int ret;
 
-	memset(&ctx, 0, sizeof(ctx));
-	init_list_head(&ctx.list);
-	ctx.nf_sock = nf_sock;
-	ctx.cache = cache;
-	ctx.msgs = msgs;
-	ctx.seqnum = cache->seqnum++;
-	ctx.debug_mask = debug_mask;
-
 	ret = cache_init_tables(&ctx, &handle, cache);
 	if (ret < 0)
 		return ret;