Recent accept() changes started depending on the protosw->pr_mport field
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 7 Jun 2004 07:01:36 +0000 (07:01 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 7 Jun 2004 07:01:36 +0000 (07:01 +0000)
commit3efe70084788876ff2d0763c7ec49044d8787002
treecca8dfc71247a5385f317b27a132f36988c3252a
parentd2e9e54c805e784f073aab41a3f9d6f571e1510a
Recent accept() changes started depending on the protosw->pr_mport field
being non-NULL, but unix domain sockets still used a NULL pr_mport field.
This was causing e.g. XFree86 to panic the system.

Unix domain socket calls must still be executed synchronously in the context
of the originating process in order to access the proc structure (for ucred
and other things).

Implement a special synchronous port (netisr_sync_port) and hook function
for the protosw called sync_soport() and hook it into the unix domain
socket protosw.  This port executes netmsg's synchronously and also supports
aborts for predicate messages (used by connect and accept).

The atm protosw also specified NULL which we change to the standard
cpu0_soport().

Remove previous workaround code for NULL mports, since we no longer have
any NULL mports.  Remove an assertion in connect2() that was designed to
detect mis-programmed use of the UNIX DOMAIN socket protosw structure.

Original-problem-reported-by: David Rhodus
sys/kern/lwkt_msgport.c
sys/kern/uipc_msg.c
sys/kern/uipc_proto.c
sys/net/netisr.c
sys/netproto/atm/atm_proto.c
sys/sys/msgport.h
sys/sys/protosw.h