Both made obsolete through struct ifnet's previous *if_nd addition.
IPv6 Neighbour Discovery handles per-interface data directly, nothing
else uses this generic domain API anymore.
Outside of _KERNEL, but nothing in base uses them, either.
OK bluhm mvs claudio
-/* $OpenBSD: util.c,v 1.11 2022/06/29 04:49:51 anton Exp $ */
+/* $OpenBSD: util.c,v 1.12 2022/11/23 14:51:00 kn Exp $ */
/*
* Copyright (c) 2015 Martin Pieuchot
.dom_protoswNPROTOSW = NULL,
.dom_rtoffset = offsetof(struct sockaddr_in, sin_addr),
.dom_maxplen = 32,
- .dom_ifattach = NULL,
- .dom_ifdetach = NULL,
};
struct domain inet6domain = {
.dom_protoswNPROTOSW = NULL,
.dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr),
.dom_maxplen = 128,
- .dom_ifattach = NULL,
- .dom_ifdetach = NULL,
};
struct domain *domains[] = { &inetdomain, &inet6domain, NULL };
-/* $OpenBSD: if.c,v 1.681 2022/11/23 14:48:27 kn Exp $ */
+/* $OpenBSD: if.c,v 1.682 2022/11/23 14:50:59 kn Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
#include <sys/device.h>
void if_attachsetup(struct ifnet *);
-void if_attachdomain(struct ifnet *);
void if_attach_common(struct ifnet *);
void if_remove(struct ifnet *);
int if_createrdomain(int, struct ifnet *);
if_addgroup(ifp, IFG_ALL);
- if_attachdomain(ifp);
#ifdef INET6
ifp->if_nd = nd6_ifattach(ifp);
#endif
ifp->if_sadl = NULL;
}
-void
-if_attachdomain(struct ifnet *ifp)
-{
- const struct domain *dp;
- int i, s;
-
- s = splnet();
-
- /* address family dependent data region */
- bzero(ifp->if_afdata, sizeof(ifp->if_afdata));
- for (i = 0; (dp = domains[i]) != NULL; i++) {
- if (dp->dom_ifattach)
- ifp->if_afdata[dp->dom_family] =
- (*dp->dom_ifattach)(ifp);
- }
-
- splx(s);
-}
-
void
if_attachhead(struct ifnet *ifp)
{
{
struct ifaddr *ifa;
struct ifg_list *ifg;
- const struct domain *dp;
int i, s;
/* Undo pseudo-driver changes. */
KASSERT(TAILQ_EMPTY(&ifp->if_linkstatehooks));
KASSERT(TAILQ_EMPTY(&ifp->if_detachhooks));
- for (i = 0; (dp = domains[i]) != NULL; i++) {
- if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family])
- (*dp->dom_ifdetach)(ifp,
- ifp->if_afdata[dp->dom_family]);
- }
#ifdef INET6
nd6_ifdetach(ifp->if_nd);
#endif
-/* $OpenBSD: if_var.h,v 1.121 2022/11/23 14:48:27 kn Exp $ */
+/* $OpenBSD: if_var.h,v 1.122 2022/11/23 14:50:59 kn Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
struct sockaddr_dl *if_sadl; /* [N] pointer to our sockaddr_dl */
- void *if_afdata[AF_MAX];
struct nd_ifinfo *if_nd; /* [I] IPv6 Neighour Discovery info */
};
#define if_mtu if_data.ifi_mtu
-/* $OpenBSD: domain.h,v 1.22 2021/05/25 22:45:10 bluhm Exp $ */
+/* $OpenBSD: domain.h,v 1.23 2022/11/23 14:50:59 kn Exp $ */
/* $NetBSD: domain.h,v 1.10 1996/02/09 18:25:07 christos Exp $ */
/*
unsigned int dom_sasize; /* size of sockaddr structure */
unsigned int dom_rtoffset; /* offset of the key, in bytes */
unsigned int dom_maxplen; /* maximum prefix length, in bits */
- void *(*dom_ifattach)(struct ifnet *);
- void (*dom_ifdetach)(struct ifnet *, void *);
- /* af-dependent data on ifnet */
};
#ifdef _KERNEL