socreate() does an early abort if either the protocol cannot be found,

or pru_attach is NULL.  With loadable protocols the SPACER dummy protocols
have valid function pointers for all methods to functions returning just
EOPNOTSUPP.  Thus the early abort check would not detect immediately that
attach is not supported for this protocol.  Instead it would correctly
get the EOPNOTSUPP error later on when it calls the protocol specific
attach function.

Add testing against the pru_attach_notsupp() function pointer to the
early abort check as well.
This commit is contained in:
Andre Oppermann 2004-10-23 19:06:43 +00:00
parent 480fa3f985
commit 3a82a5451c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136822

View File

@ -196,7 +196,8 @@ socreate(dom, aso, type, proto, cred, td)
else
prp = pffindtype(dom, type);
if (prp == NULL || prp->pr_usrreqs->pru_attach == NULL)
if (prp == NULL || prp->pr_usrreqs->pru_attach == NULL ||
prp->pr_usrreqs->pru_attach == pru_attach_notsupp)
return (EPROTONOSUPPORT);
if (jailed(cred) && jail_socket_unixiproute_only &&