diff options
author | andre <andre@FreeBSD.org> | 2004-10-23 19:06:43 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2004-10-23 19:06:43 +0000 |
commit | 5b45ea9068fa471ca45accac9877b41624ebc9dc (patch) | |
tree | 698c19027ac2ed6af2839c98cbf861d052a19200 /sys/kern/uipc_socket.c | |
parent | 1422b332e118bc73743bd81103aac4fd8b5e4636 (diff) | |
download | FreeBSD-src-5b45ea9068fa471ca45accac9877b41624ebc9dc.zip FreeBSD-src-5b45ea9068fa471ca45accac9877b41624ebc9dc.tar.gz |
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.
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r-- | sys/kern/uipc_socket.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 1a74cff..3a9fd2f 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -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 && |