From: Eugene Crosser <crosser@average.org>
To: netfilter-devel@vger.kernel.org
Cc: Eugene Crosser <crosser@average.org>
Subject: [PATCH nft v2 1/2] Use abort() in case of netlink_abi_error
Date: Thu, 9 Dec 2021 19:26:06 +0100 [thread overview]
Message-ID: <20211209182607.18550-2-crosser@average.org> (raw)
In-Reply-To: <20211209182607.18550-1-crosser@average.org>
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>
---
src/netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/netlink.c b/src/netlink.c
index 359d801c..c25a7e79 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -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,
--
2.32.0
next prev parent reply other threads:[~2021-12-09 18:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-09 18:26 [PATCH nft v2 0/2] Improve handling of errors from mnl* functions" Eugene Crosser
2021-12-09 18:26 ` Eugene Crosser [this message]
2022-01-26 1:11 ` [PATCH nft v2 1/2] Use abort() in case of netlink_abi_error Pablo Neira Ayuso
2021-12-09 18:26 ` [PATCH nft v2 2/2] Handle retriable errors from mnl functions Eugene Crosser
2022-01-27 18:20 ` Pablo Neira Ayuso
2022-01-27 18:39 ` Eugene Crosser
2022-01-27 23:04 ` Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211209182607.18550-2-crosser@average.org \
--to=crosser@average.org \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).