diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2010-06-01 14:21:24 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2010-06-01 14:21:24 +0000 |
| commit | 03b868be4c129d14d48fdca1afd3c6a84efacafd (patch) | |
| tree | fdd1d1dabfd36a7d2aa48c699d982f3637c9a526 /sys | |
| parent | 4fc9f6b81e045d8d6ea0c41f2ec1a8da69278345 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/netinet/tcp_usrreq.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 8ac1966bddc0..6ed592e175d4 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -560,9 +560,15 @@ out: } /* - * Accept a connection. Essentially all the work is - * done at higher levels; just return the address - * of the peer, storing through addr. + * Accept a connection. Essentially all the work is done at higher levels; + * just return the address of the peer, storing through addr. + * + * The rationale for acquiring the tcbinfo lock here is somewhat complicated, + * and is described in detail in the commit log entry for r175612. Acquiring + * it delays an accept(2) racing with sonewconn(), which inserts the socket + * before the inpcb address/port fields are initialized. A better fix would + * prevent the socket from being placed in the listen queue until all fields + * are fully initialized. */ static int tcp_usr_accept(struct socket *so, struct sockaddr **nam) |
