summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-05-02 14:06:23 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-05-02 16:29:30 +0200
commit9ddc4362ce64a0b273c2fbcb819fa061aadd02a5 (patch)
tree766d4b76b931e9d700d4d265d0d4ff2c0c540a59 /src/main.c
parent9c0ed46f68cada9f3455be91adb553d020012596 (diff)
src: introduce abi_breakage()
Changes in the netlink attribute layout is considered to be a kernel ABI breakage, so report this immediately and stop execution, instead of lazy error back to the client application, which cannot do anything with this. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 2cbf79e..4011ad6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -154,3 +154,10 @@ const struct nfnl_handle *nfct_nfnlh(struct nfct_handle *cth)
/**
* @}
*/
+
+void __noreturn __abi_breakage(const char *file, int line, const char *reason)
+{
+ fprintf(stderr, "ctnetlink kernel ABI is broken, contact your vendor.\n"
+ "%s:%d reason: %s\n", file, line, reason);
+ exit(EXIT_FAILURE);
+}