summaryrefslogtreecommitdiff
path: root/lib/netfilter
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-05-12 15:04:48 +0200
committerThomas Haller <thaller@redhat.com>2015-05-12 15:56:50 +0200
commit48182486341d1de7892494f272e892c0b18ebef5 (patch)
tree108923bdf7b27f8bca7a415ab17953e6b9ebf4d5 /lib/netfilter
parentc3dd6a7355ace3d1fca1e82a0eb21e0e43dddfba (diff)
downloadlibnl-48182486341d1de7892494f272e892c0b18ebef5.tar.gz
lib/doc: clearify return value of send_simple() functions
The return value of the *nl_send_simple() functions is inconsistent and not according to the documentation. nl_send_simple() is document to return the number of bytes sent. Other *nl_send_simple() functions are documented to return 0 on success -- for the most part. See also commit b70174668b9867de573cf51471bc98bfe7fd2bc3 which changed behavior of nl_rtgen_request() to be according to documenation. Don't change behavior again, only adjust the documentation. http://lists.infradead.org/pipermail/libnl/2015-May/001872.html Reported-by: Xiao Jia <stfairy@gmail.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib/netfilter')
-rw-r--r--lib/netfilter/ct.c7
-rw-r--r--lib/netfilter/exp.c7
-rw-r--r--lib/netfilter/nfnl.c3
3 files changed, 16 insertions, 1 deletions
diff --git a/lib/netfilter/ct.c b/lib/netfilter/ct.c
index 903c584e..d589790e 100644
--- a/lib/netfilter/ct.c
+++ b/lib/netfilter/ct.c
@@ -413,6 +413,13 @@ static int ct_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
return err;
}
+/**
+ * Send nfnl ct dump request
+ * @arg sk Netlink socket.
+ *
+ * @return 0 on success or a negative error code. Due to a bug, this function
+ * returns the number of bytes sent. Treat any non-negative number as success.
+ */
int nfnl_ct_dump_request(struct nl_sock *sk)
{
return nfnl_send_simple(sk, NFNL_SUBSYS_CTNETLINK, IPCTNL_MSG_CT_GET,
diff --git a/lib/netfilter/exp.c b/lib/netfilter/exp.c
index 9cfdd2bf..650127c8 100644
--- a/lib/netfilter/exp.c
+++ b/lib/netfilter/exp.c
@@ -305,6 +305,13 @@ static int exp_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
return err;
}
+/**
+ * Send nfnl exp dump request
+ * @arg sk Netlink socket.
+ *
+ * @return 0 on success or a negative error code. Due to a bug, this function
+ * returns the number of bytes sent. Treat any non-negative number as success.
+ */
int nfnl_exp_dump_request(struct nl_sock *sk)
{
return nfnl_send_simple(sk, NFNL_SUBSYS_CTNETLINK_EXP, IPCTNL_MSG_EXP_GET,
diff --git a/lib/netfilter/nfnl.c b/lib/netfilter/nfnl.c
index f028a859..9b524470 100644
--- a/lib/netfilter/nfnl.c
+++ b/lib/netfilter/nfnl.c
@@ -102,7 +102,8 @@ int nfnl_connect(struct nl_sock *sk)
* @arg family nfnetlink address family
* @arg res_id nfnetlink resource id
*
- * @return Newly allocated netlink message or NULL.
+ * @return 0 on success or a negative error code. Due to a bug, this function
+ * returns the number of bytes sent. Treat any non-negative number as success.
*/
int nfnl_send_simple(struct nl_sock *sk, uint8_t subsys_id, uint8_t type,
int flags, uint8_t family, uint16_t res_id)