]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: Fix race condition that could cause accept() to fail
authorAllan Stephens <allan.stephens@windriver.com>
Tue, 15 Jul 2008 05:43:32 +0000 (22:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Jul 2008 05:43:32 +0000 (22:43 -0700)
commit5eceb6d90d7ead2a943eedab6c778a7ced9db9e7
treea6c183dfbb0d6f929dbf09167d8bbc3d92897e53
parent37eac71335babf6e919d0dc4313e714374e8927c
tipc: Fix race condition that could cause accept() to fail

This patch ensurs that accept() returns successfully even when
the newly created socket is immediately disconnected by its peer.
Previously, accept() would fail if it was unable to pass back
the optional address info for the socket's peer before the
socket became disconnected; TIPC now allows accept() to gather
peer address information after disconnection.  As a bonus, the
revised code accesses the socket's port more efficiently, without
the overhead incurred by a reference table lookup.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c