summaryrefslogtreecommitdiff
path: root/usr.sbin/ndp
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2022-11-28 19:13:37 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2022-11-28 19:13:37 +0000
commit88e7e17e35225e06b4098f1653bdb09722029837 (patch)
tree1080614eebbcba8ff0d3c3e3f58846092cb73702 /usr.sbin/ndp
parent88b980ecb8ed908ea065dce2417b5f7d964644ef (diff)
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
Diffstat (limited to 'usr.sbin/ndp')
-rw-r--r--usr.sbin/ndp/ndp.c5
1 files changed, 1 insertions, 4 deletions
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);