`pr_type'. The corresponding domain is referenced as `pr_domain'.
Otherwise dp->dom_protosw->pr_type of inet sockets always points
to inetsw[0].
ok bluhm
-/* $OpenBSD: uipc_socket.c,v 1.319 2024/02/11 21:36:49 mvs Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.320 2024/02/12 22:48:27 mvs Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
}
struct socket *
-soalloc(const struct domain *dp, int wait)
+soalloc(const struct protosw *prp, int wait)
{
+ const struct domain *dp = prp->pr_domain;
struct socket *so;
so = pool_get(&socket_pool, (wait == M_WAIT ? PR_WAITOK : PR_NOWAIT) |
switch (dp->dom_family) {
case AF_INET:
case AF_INET6:
- switch (dp->dom_protosw->pr_type) {
+ switch (prp->pr_type) {
case SOCK_DGRAM:
case SOCK_RAW:
so->so_rcv.sb_flags |= SB_MTXLOCK;
return (EPROTONOSUPPORT);
if (prp->pr_type != type)
return (EPROTOTYPE);
- so = soalloc(pffinddomain(dom), M_WAIT);
+ so = soalloc(prp, M_WAIT);
so->so_type = type;
if (suser(p) == 0)
so->so_state = SS_PRIV;
-/* $OpenBSD: uipc_socket2.c,v 1.143 2024/02/11 18:14:26 mvs Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.144 2024/02/12 22:48:27 mvs Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
return (NULL);
if (head->so_qlen + head->so_q0len > head->so_qlimit * 3)
return (NULL);
- so = soalloc(head->so_proto->pr_domain, wait);
+ so = soalloc(head->so_proto, wait);
if (so == NULL)
return (NULL);
so->so_type = head->so_type;
-/* $OpenBSD: socketvar.h,v 1.123 2024/02/11 18:14:27 mvs Exp $ */
+/* $OpenBSD: socketvar.h,v 1.124 2024/02/12 22:48:27 mvs Exp $ */
/* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */
/*-
int soconnect2(struct socket *, struct socket *);
int socreate(int, struct socket **, int, int);
int sodisconnect(struct socket *);
-struct socket *soalloc(const struct domain *, int);
+struct socket *soalloc(const struct protosw *, int);
void sofree(struct socket *, int);
int sogetopt(struct socket *, int, int, struct mbuf *);
void sohasoutofband(struct socket *);