diff mbox series

[nft] parser_json: default to unspecified l3proto for ct helper/timeout

Message ID 20190502162057.10312-1-eric@garver.life
State Accepted
Delegated to: Pablo Neira
Headers show
Series [nft] parser_json: default to unspecified l3proto for ct helper/timeout | expand

Commit Message

Eric Garver May 2, 2019, 4:20 p.m. UTC
As per the man page, if the user does not specify the l3proto it should
be derived from the table family.

Fixes: 586ad210368b ("libnftables: Implement JSON parser")
Signed-off-by: Eric Garver <eric@garver.life>
---
 src/parser_json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Phil Sutter May 3, 2019, 3:07 p.m. UTC | #1
On Thu, May 02, 2019 at 12:20:57PM -0400, Eric Garver wrote:
> As per the man page, if the user does not specify the l3proto it should
> be derived from the table family.
> 
> Fixes: 586ad210368b ("libnftables: Implement JSON parser")
> Signed-off-by: Eric Garver <eric@garver.life>

Acked-by: Phil Sutter <phil@nwl.cc>
Pablo Neira Ayuso May 3, 2019, 3:33 p.m. UTC | #2
On Thu, May 02, 2019 at 12:20:57PM -0400, Eric Garver wrote:
> As per the man page, if the user does not specify the l3proto it should
> be derived from the table family.

Applied, thanks.
diff mbox series

Patch

diff --git a/src/parser_json.c b/src/parser_json.c
index 3fbb4457ddac..3dc3a5c5f93c 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -2817,7 +2817,7 @@  static struct cmd *json_parse_cmd_add_object(struct json_ctx *ctx,
 					     enum cmd_obj cmd_obj)
 {
 	const char *family, *tmp, *rate_unit = "packets", *burst_unit = "bytes";
-	uint32_t l3proto = NFPROTO_IPV4;
+	uint32_t l3proto = NFPROTO_UNSPEC;
 	struct handle h = { 0 };
 	struct obj *obj;
 	int inv = 0;