Fix panic by moving the prp == 0 check up the order of sanity checks.

Submitted by:	Bart Thate <freebsd@1st.dudi.org> on -current
Approved by:	rwatson
This commit is contained in:
Jeroen Ruigrok van der Werven 2000-06-13 15:44:04 +00:00
parent b1cbb3c881
commit 3b43fd626a

View File

@ -135,6 +135,9 @@ socreate(dom, aso, type, proto, p)
else
prp = pffindtype(dom, type);
if (prp == 0 || prp->pr_usrreqs->pru_attach == 0)
return (EPROTONOSUPPORT);
if (p->p_prison && jail_socket_unixiproute_only &&
prp->pr_domain->dom_family != PF_LOCAL &&
prp->pr_domain->dom_family != PF_INET &&
@ -142,8 +145,6 @@ socreate(dom, aso, type, proto, p)
return (EPROTONOSUPPORT);
}
if (prp == 0 || prp->pr_usrreqs->pru_attach == 0)
return (EPROTONOSUPPORT);
if (prp->pr_type != type)
return (EPROTOTYPE);
so = soalloc(p != 0);