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
connections. While this confuses tcpdump, it enables other applications
to see and analyze non-IP traffic (signalling, for example).
Pointed out by: Vincent Jardin <vjardin@wanadoo.fr>
These were a left over from when the private memory pools were
converted to use uma zones. The limit of UMA zones, however,
works differently. When a zone is limited to only one or two pages
than, on multi-cpu systems, processes can get stuck on the zonelimit,
because all remaining free items are in caches of other CPUs.
Also add rudimentary error handling in some places (panic) when a zone
cannot be created.
Atm_connection items.
- Replaced the Atm_connvc storage pool with an uma_zone of Atm_connvc
items.
- Created void atm_cm_init(void *) and added it to the netatm init code.
I'm thinking that there will definetly be more ``subsystem'' init
functions to be added so I'll probably change these calls to be a for
loop through init routines (or something).
calls associated with the pool and the objects allocated out from the
pool.
- Insert atm_attributes_zone which is a uma_zone that is used just as the
atm_attributes_pool was (including the max objects value). Also, used
the appropriate zalloc and zfree's where necesary.
the #includes to the respective source files.
Also un-nest includes in <dev/hfa/fore_include.h>
I have run src/tools/tools/kerninclude to remove 1239 clearly
unneeded #includes reducing the total from 3524 includes to 2285.
Host ATM Research Platform (HARP), Network Computing Services, Inc.
This software was developed with the support of the Defense Advanced
Research Projects Agency (DARPA).