From 88e7e17e35225e06b4098f1653bdb09722029837 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Mon, 28 Nov 2022 19:13:37 +0000 Subject: Document struct nd_ifinfo protection, remove obsolete .initialized member All access to struct ifnet's member *if_nd is read-only, with the one write exception being nd6_slowtimo() updating ND information. IPv6 Neighbour Discovery information is fully protected by the net lock. --- nd6_ifattach() allocates and unconditionally initialises struct ifnet's *if_nd member, so early in if_attachsetup() that there is no way to query unitialised Neighour Unreachable Detection bits. Only SIOCGIFINFO_IN6 through ndp(8) used the .initialized member: Added/set since 2002 sys/netinet6/nd6.c r1.42 attach nd_ifinfo structure to if_afdata. split IPv6 MTU (advertised by RA) from real link MTU. sync with kame Read since 2002 usr.sbin/ndp/ndp.c r1.16 use new SIOCGIFINFO_IN6. random other cleanups. sync w/kame. Obsolete since 2017 sys/netinet6/nd6.c r1.217 usr.sbin/ndp/ndp.c r1.85 Remove knob and always do neighbor unreachable detection. Feedback OK bluhm --- usr.sbin/ndp/ndp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'usr.sbin/ndp') diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 8b3cfeeb300..80cca743bc4 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ndp.c,v 1.104 2022/11/09 18:00:02 kn Exp $ */ +/* $OpenBSD: ndp.c,v 1.105 2022/11/28 19:13:36 kn Exp $ */ /* $KAME: ndp.c,v 1.101 2002/07/17 08:46:33 itojun Exp $ */ /* @@ -888,9 +888,6 @@ ifinfo(const char *ifname) if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd) == -1) err(1, "ioctl(SIOCGIFINFO_IN6)"); - if (!nd.ndi.initialized) - errx(1, "%s: not initialized yet", ifname); - printf("basereachable=%ds%dms", nd.ndi.basereachable / 1000, nd.ndi.basereachable % 1000); printf(", reachable=%ds", nd.ndi.reachable); -- cgit v1.2.3