]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
netlink: Keep going after set element parsing failures
authorPhil Sutter <phil@nwl.cc>
Fri, 16 May 2025 17:33:25 +0000 (19:33 +0200)
committerPhil Sutter <phil@nwl.cc>
Sun, 25 May 2025 07:55:35 +0000 (09:55 +0200)
Print an error message and try to deserialize the remaining elements
instead of calling BUG().

Signed-off-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/netlink.c

index 0154728b795ae83b571eb4760776749d45447a9a..bed816af3123d08586fbda62c3fdec5bc07c3307 100644 (file)
@@ -1452,7 +1452,9 @@ key_end:
                key->byteorder = set->key->byteorder;
                key->len = set->key->len;
        } else {
-               BUG("Unexpected set element with no key\n");
+               netlink_io_error(ctx, NULL,
+                                "Unexpected set element with no key");
+               return 0;
        }
 
        expr = set_elem_expr_alloc(&netlink_location, key);