diff options
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | include/linux_list.h | 2 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/iftable.c | 6 | ||||
-rw-r--r-- | src/libnfnetlink.c | 23 |
5 files changed, 27 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac index 922ec09..4593824 100644 --- a/configure.ac +++ b/configure.ac @@ -1,12 +1,12 @@ dnl Process this file with autoconf to create configure. -AC_INIT(libnfnetlink, 1.0.1) +AC_INIT(libnfnetlink, 1.0.2) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE([-Wall foreign subdir-objects - tar-pax no-dist-gzip dist-bzip2 1.6]) + tar-pax no-dist-gzip dist-xz 1.6]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) dnl kernel style compile messages diff --git a/include/linux_list.h b/include/linux_list.h index de182a4..cf71837 100644 --- a/include/linux_list.h +++ b/include/linux_list.h @@ -29,7 +29,7 @@ 1; \ }) -#define prefetch(x) 1 +#define prefetch(x) ((void)0) /* empty define to make this work in userspace -HW */ #ifndef smp_wmb 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; |