-/* $OpenBSD: if.c,v 1.682 2022/11/23 14:50:59 kn Exp $ */
+/* $OpenBSD: if.c,v 1.683 2022/11/23 16:57:37 kn Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
if_addgroup(ifp, IFG_ALL);
#ifdef INET6
- ifp->if_nd = nd6_ifattach(ifp);
+ nd6_ifattach(ifp);
#endif
#if NPF > 0
KASSERT(TAILQ_EMPTY(&ifp->if_detachhooks));
#ifdef INET6
- nd6_ifdetach(ifp->if_nd);
+ nd6_ifdetach(ifp);
#endif
/* Announce that the interface is gone. */
-/* $OpenBSD: nd6.c,v 1.251 2022/11/23 08:05:49 kn Exp $ */
+/* $OpenBSD: nd6.c,v 1.252 2022/11/23 16:57:37 kn Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
timeout_set(&nd6_expire_timeout, nd6_expire_timer, NULL);
}
-struct nd_ifinfo *
+void
nd6_ifattach(struct ifnet *ifp)
{
struct nd_ifinfo *nd;
nd->reachable = ND_COMPUTE_RTIME(nd->basereachable);
nd->retrans = RETRANS_TIMER;
- return nd;
+ ifp->if_nd = nd;
}
void
-nd6_ifdetach(struct nd_ifinfo *nd)
+nd6_ifdetach(struct ifnet *ifp)
{
+ struct nd_ifinfo *nd = ifp->if_nd;
free(nd, M_IP6NDP, sizeof(*nd));
}
-/* $OpenBSD: nd6.h,v 1.84 2022/11/23 14:48:28 kn Exp $ */
+/* $OpenBSD: nd6.h,v 1.85 2022/11/23 16:57:37 kn Exp $ */
/* $KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $ */
/*
#define nd_opts_done nd_opt_each.done
void nd6_init(void);
-struct nd_ifinfo *nd6_ifattach(struct ifnet *);
-void nd6_ifdetach(struct nd_ifinfo *);
+void nd6_ifattach(struct ifnet *);
+void nd6_ifdetach(struct ifnet *);
int nd6_is_addr_neighbor(const struct sockaddr_in6 *, struct ifnet *);
void nd6_option_init(void *, int, union nd_opts *);
struct nd_opt_hdr *nd6_option(union nd_opts *);