summaryrefslogtreecommitdiffstats
path: root/src/libnfnetlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnfnetlink.c')
-rw-r--r--src/libnfnetlink.c23
1 files changed, 18 insertions, 5 deletions
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;