Fix a bug in the distributed PCB wildcardhash code for TCP. For the SMP
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 5 Apr 2005 05:43:05 +0000 (05:43 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 5 Apr 2005 05:43:05 +0000 (05:43 +0000)
commitf3a4db39cf50735f8a34c692ced2aa0063412a60
treea123b848dd78bffc0028a47c81ae3a1fc4701e5b
parent6f3f7e7c07c06f36b0cb710fc17fd838d7a7c97d
Fix a bug in the distributed PCB wildcardhash code for TCP.   For the SMP
case both the INP_WILDCARD and INP_WILDCARD_MP flags must be set.  The
insertion code was calling in_pcbinswildcardhash_oncpu() instead of
in_pcbinswildcardhash() for the current-cpu case, which leaves the
INP_WILDCARD flag unset.  The wildcard deletion code calls various
oncpu routines which remove the wildcard from the other cpu's hash
tables, then finally calls in_pcbdetach()->in_pcbremlist() on the
originating cpu but this fails to delete the inp because INP_WILDCARD
was not set.

This bug caused the TCP stack to get seriously confused because wildcard
entries with stale inp pointers wind up being left in the hash table.
The bug causes a mix of ignored connection requests (not even an RST),
refused connection requests, successful connection requests, and crashes.

Reported-by: Peter Avalos <pavalos@theshell.com>
sys/netinet/tcp_usrreq.c