Skip to content

Commit

Permalink
netlink-socket: return correct error code when connect fails
Browse files Browse the repository at this point in the history
When connect and other calls fail after get_socket_rcvbuf, the return code would
be the rcvbuf size, not errno from the last call.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
  • Loading branch information
Thadeu Lima de Souza Cascardo authored and blp committed Feb 16, 2016
1 parent 52407a0 commit ceb8469
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/netlink-socket.c
Expand Up @@ -139,6 +139,7 @@ nl_sock_create(int protocol, struct nl_sock **sockp)
goto error;
}
sock->rcvbuf = retval;
retval = 0;

/* Connect to kernel (pid 0) as remote address. */
memset(&remote, 0, sizeof remote);
Expand Down

0 comments on commit ceb8469

Please sign in to comment.