]> git.ipfire.org Git - thirdparty/libnl.git/commitdiff
Inherit return code of NL_CB_MSG_OUT in nl_sendmsg()
authorThomas Graf <tgraf@suug.ch>
Thu, 18 Nov 2010 13:16:33 +0000 (14:16 +0100)
committerThomas Graf <tgraf@suug.ch>
Thu, 18 Nov 2010 13:16:33 +0000 (14:16 +0100)
If NL_CB_MSG_OUT() returns anything != NL_OK, return that value
to let any caller of nl_sendmsg() know that the message has not
been sent.

lib/nl.c

index cd6e6c725bc59db9ac4ffbcf5c60e908db1ddc9f..4e09b9ec4f8fb28f71a44e8ce0bde0fb210dc72b 100644 (file)
--- a/lib/nl.c
+++ b/lib/nl.c
@@ -211,8 +211,8 @@ int nl_sendmsg(struct nl_sock *sk, struct nl_msg *msg, struct msghdr *hdr)
 
        cb = sk->s_cb;
        if (cb->cb_set[NL_CB_MSG_OUT])
-               if (nl_cb_call(cb, NL_CB_MSG_OUT, msg) != NL_OK)
-                       return 0;
+               if ((ret = nl_cb_call(cb, NL_CB_MSG_OUT, msg)) != NL_OK)
+                       return ret;
 
        ret = sendmsg(sk->s_fd, hdr, 0);
        if (ret < 0)