]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
netlink: Use abort() in case of netlink_abi_error
authorEugene Crosser <crosser@average.org>
Thu, 9 Dec 2021 18:26:06 +0000 (19:26 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 26 Jan 2022 01:10:59 +0000 (02:10 +0100)
Library functions should not use exit(), application that uses the
library may contain error handling path, that cannot be executed if
library functions calls exit(). For truly fatal errors, using abort() is
more acceptable than exit().

Signed-off-by: Eugene Crosser <crosser@average.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/netlink.c

index 15b8878eb488f19f67a8588e51506bc9ae0faa7d..b6d34832173971d90585d8efad8b985ec9484c08 100644 (file)
@@ -59,7 +59,7 @@ void __noreturn __netlink_abi_error(const char *file, int line,
 {
        fprintf(stderr, "E: Contact urgently your Linux kernel vendor. "
                "Netlink ABI is broken: %s:%d %s\n", file, line, reason);
-       exit(NFT_EXIT_FAILURE);
+       abort();
 }
 
 int netlink_io_error(struct netlink_ctx *ctx, const struct location *loc,