SCCS-vsn: sys/kern/uipc_domain.c 6.5
-/* uipc_domain.c 6.4 85/04/27 */
+/* uipc_domain.c 6.5 85/06/02 */
#include "param.h"
#include "socket.h"
#include "param.h"
#include "socket.h"
-pffindproto(family, protocol)
- int family, protocol;
+pffindproto(family, protocol, type)
+ int family, protocol, type;
{
register struct domain *dp;
register struct protosw *pr;
{
register struct domain *dp;
register struct protosw *pr;
+ struct protosw *maybe = 0;
if (family == 0)
return (0);
if (family == 0)
return (0);
goto found;
return (0);
found:
goto found;
return (0);
found:
- for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
+ for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) {
if (pr->pr_protocol == protocol)
return (pr);
if (pr->pr_protocol == protocol)
return (pr);
+ if (type == SOCK_RAW && pr->pr_type == SOCK_RAW &&
+ pr->pr_protocol == 0 && maybe == (struct protosw *)0)
+ maybe = pr;
+ }
+ return (maybe);