0daccb9c94
a socket from a regular socket to a listening socket able to accept new connections. As part of this state transition, solisten() calls into the protocol to update protocol-layer state. There were several bugs in this implementation that could result in a race wherein a TCP SYN received in the interval between the protocol state transition and the shortly following socket layer transition would result in a panic in the TCP code, as the socket would be in the TCPS_LISTEN state, but the socket would not have the SO_ACCEPTCONN flag set. This change does the following: - Pushes the socket state transition from the socket layer solisten() to to socket "library" routines called from the protocol. This permits the socket routines to be called while holding the protocol mutexes, preventing a race exposing the incomplete socket state transition to TCP after the TCP state transition has completed. The check for a socket layer state transition is performed by solisten_proto_check(), and the actual transition is performed by solisten_proto(). - Holds the socket lock for the duration of the socket state test and set, and over the protocol layer state transition, which is now possible as the socket lock is acquired by the protocol layer, rather than vice versa. This prevents additional state related races in the socket layer. This permits the dual transition of socket layer and protocol layer state to occur while holding locks for both layers, making the two changes atomic with respect to one another. Similar changes are likely require elsewhere in the socket/protocol code. Reported by: Peter Holm <peter@holm.cc> Review and fixes from: emax, Antoine Brodin <antoine.brodin@laposte.net> Philosophical head nod: gnn |
||
---|---|---|
.. | ||
ipx_cksum.c | ||
ipx_if.h | ||
ipx_input.c | ||
ipx_ip.c | ||
ipx_ip.h | ||
ipx_outputfl.c | ||
ipx_pcb.c | ||
ipx_pcb.h | ||
ipx_proto.c | ||
ipx_usrreq.c | ||
ipx_var.h | ||
ipx.c | ||
ipx.h | ||
README | ||
spx_debug.c | ||
spx_debug.h | ||
spx_timer.h | ||
spx_usrreq.c | ||
spx_var.h | ||
spx.h |
$FreeBSD$ This protocol implements IPX/SPX over Ethernet_II frame type 0x8137. Please note: the SPX implementation may require further work and testing to insure proper operation. Mike Mitchell, Network Engineer AMTECH Systems Corporation, Technology and Manufacturing 8600 Jefferson Street, Albuquerque, New Mexico 87113 (505) 856-8000 supervisor@alb.asctmd.com John Hay Some Company Some Address jhay@mikom.csir.co.za --- Copyright Information --- /*- Copyright (c) 1984, 1985, 1986, 1987, 1993 The Regents of the University of California. All rights reserved. Modifications Copyright (c) 2004, Robert N. M. Watson Modifications Copyright (c) 1995, Mike Mitchell Modifications Copyright (c) 1995, John Hay */