-/* $OpenBSD: in6.c,v 1.253 2022/11/22 15:49:06 kn Exp $ */
+/* $OpenBSD: in6.c,v 1.254 2022/11/22 19:28:29 kn Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
void *
in6_domifattach(struct ifnet *ifp)
{
- return nd6_ifattach(ifp);
+ struct in6_ifextra *ext;
+
+ ext = malloc(sizeof(*ext), M_IFADDR, M_WAITOK | M_ZERO);
+
+ ext->nd_ifinfo = nd6_ifattach(ifp);
+ return ext;
}
void
in6_domifdetach(struct ifnet *ifp, void *aux)
{
- nd6_ifdetach(aux);
+ struct in6_ifextra *ext = (struct in6_ifextra *)aux;
+
+ nd6_ifdetach(ext->nd_ifinfo);
+ free(ext, M_IFADDR, sizeof(*ext));
}
-/* $OpenBSD: in6_var.h,v 1.76 2022/11/22 14:51:01 kn Exp $ */
+/* $OpenBSD: in6_var.h,v 1.77 2022/11/22 19:28:29 kn Exp $ */
/* $KAME: in6_var.h,v 1.55 2001/02/16 12:49:45 itojun Exp $ */
/*
};
#ifdef _KERNEL
+struct nd_ifinfo;
+struct in6_ifextra {
+ struct nd_ifinfo *nd_ifinfo;
+};
+
struct in6_ifaddr {
struct ifaddr ia_ifa; /* protocol-independent info */
#define ia_ifp ia_ifa.ifa_ifp
-/* $OpenBSD: nd6.h,v 1.81 2022/11/22 14:51:01 kn Exp $ */
+/* $OpenBSD: nd6.h,v 1.82 2022/11/22 19:28:29 kn Exp $ */
/* $KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $ */
/*
#include <sys/queue.h>
#define ND_IFINFO(ifp) \
- ((struct nd_ifinfo *)(ifp)->if_afdata[AF_INET6])
+ (((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->nd_ifinfo)
struct llinfo_nd6 {
TAILQ_ENTRY(llinfo_nd6) ln_list;