network - Fix multiple MP races
* Fix sonewconn() races. sonewconn() was attaching prior to changing
the socket->so_port, relying on the caller to set the socket->so_port.
This resulted in a race where userland wound up with visibility on the
socket and could issue commands, like close(), which would end up going
to the original protocol thread instead of the post-connect protocol thread
which was handling the sonewconn().
Thus the close() could message the backend to detach and compete
against the sonewconn() because the detach message was going to
a different protocol thread.
* When the socket->so_port is changed the inpcb was not being moved
from the old pcbinfo->pcblisthead list to the new one, resulting
in MP races later on during removal.
* Add more debugging kprintf()s.
* Clean up sosetport() use, remove the now-unused *_soport_attach().
Reported-by: Many
14 files changed: