original_kernel/net/tipc
Erik Hugne 2c8d851823 tipc: set sk_err correctly when connection fails
Should a connect fail, if the publication/server is unavailable or
due to some other error, a positive value will be returned and errno
is never set. If the application code checks for an explicit zero
return from connect (success) or a negative return (failure), it
will not catch the error and subsequent send() calls will fail as
shown from the strace snippet below.

socket(0x1e /* PF_??? */, SOCK_SEQPACKET, 0) = 3
connect(3, {sa_family=0x1e /* AF_??? */, sa_data="\2\1\322\4\0\0\322\4\0\0\0\0\0\0"}, 16) = 111
sendto(3, "test", 4, 0, NULL, 0)        = -1 EPIPE (Broken pipe)

The reason for this behaviour is that TIPC wrongly inverts error
codes set in sk_err.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-08-30 16:06:57 -04:00
..
Kconfig
Makefile
addr.c
addr.h
bcast.c tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
bcast.h tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
bearer.c tipc: avoid possible deadlock while enable and disable bearer 2013-08-11 21:58:41 -07:00
bearer.h
config.c
config.h
core.c
core.h
discover.c tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
discover.h
eth_media.c tipc: remove dev_base_lock use from enable_bearer 2013-06-17 15:53:01 -07:00
handler.c
ib_media.c net/tipc: use %*phC to dump small buffers in hex form 2013-07-11 17:03:36 -07:00
link.c tipc: fix wrong return value for link_send_sections_long routine 2013-06-17 15:53:01 -07:00
link.h
log.c
msg.c tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
msg.h tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
name_distr.c
name_distr.h
name_table.c tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
name_table.h tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
net.c
net.h
netlink.c
node.c
node.h
node_subscr.c tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
node_subscr.h
port.c tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
port.h tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
ref.c
ref.h
server.c tipc: fix oops when creating server socket fails 2013-08-01 15:54:33 -07:00
server.h
socket.c tipc: set sk_err correctly when connection fails 2013-08-30 16:06:57 -04:00
subscr.c tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
subscr.h tipc: cosmetic realignment of function arguments 2013-06-17 15:53:01 -07:00
sysctl.c