]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser_json: default to unspecified l3proto for ct helper/timeout
authorEric Garver <eric@garver.life>
Thu, 2 May 2019 16:20:57 +0000 (12:20 -0400)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 3 May 2019 15:33:01 +0000 (17:33 +0200)
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>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/parser_json.c

index 5c00c9b003b608c800971107c3a9a95d2db12ed1..72e712f352e9feb0d3bc3bde86cd860acb9387ee 100644 (file)
@@ -2811,7 +2811,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;