summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/iftable.c6
-rw-r--r--src/libnfnetlink.c23
3 files changed, 24 insertions, 7 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 5524b0f..877ff31 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,7 +5,7 @@ lib_LTLIBRARIES = libnfnetlink.la
libnfnetlink_la_LDFLAGS = -Wc,-nostartfiles \
-version-info $(LIBVERSION) \
-Wl,--version-script=$(srcdir)/nfnl.version
-libnfnetlink_la_SOURCES = libnfnetlink.c iftable.c rtnl.c
+libnfnetlink_la_SOURCES = libnfnetlink.c iftable.c rtnl.c nfnl.version
EXTRA_libnfnetlink_la_DEPENDENCIES = $(srcdir)/nfnl.version
noinst_HEADERS = iftable.h rtnl.h
diff --git a/src/iftable.c b/src/iftable.c
index 6d1d135..aab59b3 100644
--- a/src/iftable.c
+++ b/src/iftable.c
@@ -25,7 +25,11 @@
#include "linux_list.h"
/**
- * \defgroup iftable Functions in iftable.c
+ * \defgroup iftable Functions in iftable.c [DEPRECATED]
+ * This documentation is provided for the benefit of maintainers of legacy code.
+ *
+ * New applications should use
+ * [libmnl](https://netfilter.org/projects/libmnl/doxygen/html/).
* @{
*/
diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c
index 3db21e0..667e5ef 100644
--- a/src/libnfnetlink.c
+++ b/src/libnfnetlink.c
@@ -55,12 +55,23 @@
/**
* \mainpage
*
- * libnfnetlink is the bottom-level communication between the kernel and
- * userspace
+ * Deprecated
+ * ---
+ * New applications should use
+ * [libmnl](https://netfilter.org/projects/libmnl/doxygen/html/).
+ *
+ * [libnetfilter_queue]
+ * (https://netfilter.org/projects/libnetfilter_queue/doxygen/html/)
+ * now provides a set of helpers for libmnl, in addition to those it provides
+ * for libnfnetlink (which are now deprecated).
*/
/**
- * \defgroup libnfnetlink Functions in libnfnetlink.c
+ * \defgroup libnfnetlink Functions in libnfnetlink.c [DEPRECATED]
+ * This documentation is provided for the benefit of maintainers of legacy code.
+ *
+ * New applications should use
+ * [libmnl](https://netfilter.org/projects/libmnl/doxygen/html/).
* @{
*/
@@ -199,7 +210,8 @@ struct nfnl_handle *nfnl_open(void)
nfnlh->peer.nl_family = AF_NETLINK;
addr_len = sizeof(nfnlh->local);
- getsockname(nfnlh->fd, (struct sockaddr *)&nfnlh->local, &addr_len);
+ if (getsockname(nfnlh->fd, (struct sockaddr *)&nfnlh->local, &addr_len))
+ goto err_close;
if (addr_len != sizeof(nfnlh->local)) {
errno = EINVAL;
goto err_close;
@@ -220,7 +232,8 @@ struct nfnl_handle *nfnl_open(void)
/* use getsockname to get the netlink pid that the kernel assigned us */
addr_len = sizeof(nfnlh->local);
- getsockname(nfnlh->fd, (struct sockaddr *)&nfnlh->local, &addr_len);
+ if (getsockname(nfnlh->fd, (struct sockaddr *)&nfnlh->local, &addr_len))
+ goto err_close;
if (addr_len != sizeof(nfnlh->local)) {
errno = EINVAL;
goto err_close;