Commit 6e94a238 authored by Thadeu Lima de Souza Cascardo's avatar Thadeu Lima de Souza Cascardo Committed by Ben Pfaff

netlink-socket: return correct error code when connect fails

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: default avatarThadeu Lima de Souza Cascardo <>
Signed-off-by: default avatarSimon Horman <>
parent 46ab6540
......@@ -195,6 +195,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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment