-/* $OpenBSD: uipc_domain.c,v 1.64 2023/05/18 10:23:19 mvs Exp $ */
+/* $OpenBSD: uipc_domain.c,v 1.65 2024/01/11 14:15:11 bluhm Exp $ */
/* $NetBSD: uipc_domain.c,v 1.14 1996/02/09 19:00:44 christos Exp $ */
/*
void pffasttimo(void *);
void pfslowtimo(void *);
-const struct domain * pffinddomain(int);
void
domaininit(void)
-/* $OpenBSD: uipc_socket.c,v 1.312 2023/12/19 21:34:22 bluhm Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.313 2024/01/11 14:15:11 bluhm Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
}
struct socket *
-soalloc(int wait)
+soalloc(const struct domain *dp, int wait)
{
struct socket *so;
PR_ZERO);
if (so == NULL)
return (NULL);
- rw_init_flags(&so->so_lock, "solock", RWL_DUPOK);
+ rw_init_flags(&so->so_lock, dp->dom_name, RWL_DUPOK);
refcnt_init(&so->so_refcnt);
klist_init(&so->so_rcv.sb_klist, &socket_klistops, so);
klist_init(&so->so_snd.sb_klist, &socket_klistops, so);
return (EPROTONOSUPPORT);
if (prp->pr_type != type)
return (EPROTOTYPE);
- so = soalloc(M_WAIT);
+ so = soalloc(pffinddomain(dom), M_WAIT);
so->so_type = type;
if (suser(p) == 0)
so->so_state = SS_PRIV;
-/* $OpenBSD: uipc_socket2.c,v 1.139 2023/12/18 13:11:20 bluhm Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.140 2024/01/11 14:15:11 bluhm 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(wait);
+ so = soalloc(head->so_proto->pr_domain, wait);
if (so == NULL)
return (NULL);
so->so_type = head->so_type;
-/* $OpenBSD: pfkeyv2.c,v 1.259 2023/10/11 22:13:16 tobhe Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.260 2024/01/11 14:15:11 bluhm Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
const struct domain pfkeydomain = {
.dom_family = PF_KEY,
- .dom_name = "PF_KEY",
+ .dom_name = "pfkey",
.dom_init = pfkey_init,
.dom_protosw = pfkeysw,
.dom_protoswNPROTOSW = &pfkeysw[nitems(pfkeysw)],
-/* $OpenBSD: in_proto.c,v 1.102 2023/07/06 04:55:05 dlg Exp $ */
+/* $OpenBSD: in_proto.c,v 1.103 2024/01/11 14:15:12 bluhm Exp $ */
/* $NetBSD: in_proto.c,v 1.14 1996/02/18 18:58:32 christos Exp $ */
/*
const struct domain inetdomain = {
.dom_family = AF_INET,
- .dom_name = "internet",
+ .dom_name = "inet",
.dom_init = in_init,
.dom_protosw = inetsw,
.dom_protoswNPROTOSW = &inetsw[nitems(inetsw)],
-/* $OpenBSD: in6_proto.c,v 1.112 2022/11/23 14:48:28 kn Exp $ */
+/* $OpenBSD: in6_proto.c,v 1.113 2024/01/11 14:15:12 bluhm Exp $ */
/* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */
/*
const struct domain inet6domain = {
.dom_family = AF_INET6,
- .dom_name = "internet6",
+ .dom_name = "inet6",
.dom_protosw = inet6sw,
.dom_protoswNPROTOSW = &inet6sw[nitems(inet6sw)],
.dom_sasize = sizeof(struct sockaddr_in6),
-/* $OpenBSD: domain.h,v 1.23 2022/11/23 14:50:59 kn Exp $ */
+/* $OpenBSD: domain.h,v 1.24 2024/01/11 14:15:12 bluhm Exp $ */
/* $NetBSD: domain.h,v 1.10 1996/02/09 18:25:07 christos Exp $ */
/*
struct domain {
int dom_family; /* AF_xxx */
- char *dom_name;
+ const char *dom_name;
void (*dom_init)(void); /* initialize domain data structures */
/* externalize access rights */
int (*dom_externalize)(struct mbuf *, socklen_t, int);
-/* $OpenBSD: protosw.h,v 1.63 2023/12/18 13:11:20 bluhm Exp $ */
+/* $OpenBSD: protosw.h,v 1.64 2024/01/11 14:15:12 bluhm Exp $ */
/* $NetBSD: protosw.h,v 1.10 1996/04/09 20:55:32 cgd Exp $ */
/*-
struct sockaddr;
const struct protosw *pffindproto(int, int, int);
const struct protosw *pffindtype(int, int);
+const struct domain *pffinddomain(int);
void pfctlinput(int, struct sockaddr *);
extern u_char ip_protox[];
-/* $OpenBSD: socketvar.h,v 1.120 2023/07/04 22:28:24 mvs Exp $ */
+/* $OpenBSD: socketvar.h,v 1.121 2024/01/11 14:15:12 bluhm 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(int);
+struct socket *soalloc(const struct domain *, int);
void sofree(struct socket *, int);
int sogetopt(struct socket *, int, int, struct mbuf *);
void sohasoutofband(struct socket *);