netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nft PATCH] netlink: include file and line in netlink ABI errors
@ 2014-09-15 12:10 Arturo Borrero Gonzalez
  2014-09-16 17:30 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Arturo Borrero Gonzalez @ 2014-09-15 12:10 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

Let's give some more information when netlink ABI errors happens.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 include/netlink.h |    4 +++-
 src/netlink.c     |    5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/netlink.h b/include/netlink.h
index f611452..2df3742 100644
--- a/include/netlink.h
+++ b/include/netlink.h
@@ -139,7 +139,9 @@ extern void netlink_dump_set(struct nft_set *nls);
 extern int netlink_batch_send(struct list_head *err_list);
 
 extern void netlink_restart(void);
-extern void netlink_abi_error(void) __noreturn;
+#define netlink_abi_error()	\
+	__netlink_abi_error(__FILE__, __LINE__, strerror(errno));
+extern void __noreturn __netlink_abi_error(const char *file, int line, const char *reason);
 extern int netlink_io_error(struct netlink_ctx *ctx,
 			    const struct location *loc, const char *fmt, ...);
 extern void netlink_open_error(void) __noreturn;
diff --git a/src/netlink.c b/src/netlink.c
index 7d42ad6..1ce74e7 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -80,10 +80,11 @@ static void netlink_open_mon_sock(void)
 	nf_mon_sock = nfsock_open();
 }
 
-void __noreturn netlink_abi_error(void)
+void __noreturn __netlink_abi_error(const char *file, int line,
+				    const char *reason)
 {
 	fprintf(stderr, "E: Contact urgently your Linux kernel vendor. "
-		"Netlink ABI is broken: %s\n", strerror(errno));
+		"Netlink ABI is broken: %s:%d %s\n", file, line, reason);
 	exit(NFT_EXIT_FAILURE);
 }
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [nft PATCH] netlink: include file and line in netlink ABI errors
  2014-09-15 12:10 [nft PATCH] netlink: include file and line in netlink ABI errors Arturo Borrero Gonzalez
@ 2014-09-16 17:30 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2014-09-16 17:30 UTC (permalink / raw)
  To: Arturo Borrero Gonzalez; +Cc: netfilter-devel

On Mon, Sep 15, 2014 at 02:10:45PM +0200, Arturo Borrero Gonzalez wrote:
> Let's give some more information when netlink ABI errors happens.

Applied, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-16 17:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-15 12:10 [nft PATCH] netlink: include file and line in netlink ABI errors Arturo Borrero Gonzalez
2014-09-16 17:30 ` Pablo Neira Ayuso

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).