Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/uipc_socket.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -p -r1.119 -r1.120 --- src/sys/kern/uipc_socket.c 2006/05/25 14:27:28 1.119 +++ src/sys/kern/uipc_socket.c 2006/06/13 21:19:56 1.120 @@ -1,4 +1,4 @@ -/* $NetBSD: uipc_socket.c,v 1.119 2006/05/25 14:27:28 yamt Exp $ */ +/* $NetBSD: uipc_socket.c,v 1.120 2006/06/13 21:19:56 ginsbach Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.119 2006/05/25 14:27:28 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.120 2006/06/13 21:19:56 ginsbach Exp $"); #include "opt_sock_counters.h" #include "opt_sosend_loan.h" @@ -478,7 +478,16 @@ socreate(int dom, struct socket **aso, i prp = pffindproto(dom, proto, type); else prp = pffindtype(dom, type); - if (prp == 0 || prp->pr_usrreq == 0) + if (prp == 0) { + /* no support for domain */ + if (pffinddomain(dom) == 0) + return (EAFNOSUPPORT); + /* no support for socket type */ + if (proto == 0 && type != 0) + return (EPROTOTYPE); + return (EPROTONOSUPPORT); + } + if (prp->pr_usrreq == 0) return (EPROTONOSUPPORT); if (prp->pr_type != type) return (EPROTOTYPE);