CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]   2017/08/04 12:16:42

Modified files:
        sys/netinet    : in_pcb.c 
        sys/netinet6   : in6_pcb.c 

Log message:
The in_pcbhashlookup() in in_pcbconnect() enforces that the 4 tupel
of src/dst ip/port is unique for TCP.  But if the socket is not
bound, the automatic bind by connect happens after the check.  If
the socket has the SO_REUSEADDR flag, in_pcbbind() may select an
existing local port.  Then we had two colliding TCP PCBs.  This
resulted in a packet storm of ACK packets on loopback.  The softnet
task was constantly holding the netlock and has a high priority,
so the system hung.
Do the in_pcbhashlookup() again after in_pcbbind().  This creates
sporadic "connect: Address already in use" errors instead of a hang.
bug report and testing Olivier Antoine; OK mpi@

Reply via email to