]> err.no Git - linux-2.6/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)
commit2da59918e26837f305131cfac9c0f1b3b42bb8ae
treea6c183dfbb0d6f929dbf09167d8bbc3d92897e53
parent8642bd9e04f51980b2b6293c66acf7e388c9a6e7
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