Inherit return code of NL_CB_MSG_OUT in nl_sendmsg()
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.
This commit is contained in:
parent
8a365dbd49
commit
5a08c8ff4c
4
lib/nl.c
4
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;
|
cb = sk->s_cb;
|
||||||
if (cb->cb_set[NL_CB_MSG_OUT])
|
if (cb->cb_set[NL_CB_MSG_OUT])
|
||||||
if (nl_cb_call(cb, NL_CB_MSG_OUT, msg) != NL_OK)
|
if ((ret = nl_cb_call(cb, NL_CB_MSG_OUT, msg)) != NL_OK)
|
||||||
return 0;
|
return ret;
|
||||||
|
|
||||||
ret = sendmsg(sk->s_fd, hdr, 0);
|
ret = sendmsg(sk->s_fd, hdr, 0);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|
Reference in New Issue