aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6/nd6.c
diff options
context:
space:
mode:
authorHidetoshi Shimokawa <simokawa@FreeBSD.org>2001-02-20 10:23:25 +0000
committerHidetoshi Shimokawa <simokawa@FreeBSD.org>2001-02-20 10:23:25 +0000
commitbf1c6fef38a3f3f148d8643e23502b336161bfe7 (patch)
tree015c80aaffe50bd7e9417570ee3d8577e2bb46a5 /sys/netinet6/nd6.c
parentaae101bd15dcba7d84ad56cfcc531266e3bb034d (diff)
downloadsrc-bf1c6fef38a3f3f148d8643e23502b336161bfe7.tar.gz
src-bf1c6fef38a3f3f148d8643e23502b336161bfe7.zip
Better detection of duplicated initialization.
Obtained from: KAME
Notes
Notes: svn path=/head/; revision=72758
Diffstat (limited to 'sys/netinet6/nd6.c')
-rw-r--r--sys/netinet6/nd6.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 373158512bd4..4298ce2a45b9 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -158,8 +158,14 @@ nd6_ifattach(ifp)
#define ND nd_ifinfo[ifp->if_index]
- /* don't initialize if called twice */
- if (ND.linkmtu)
+ /*
+ * Don't initialize if called twice.
+ * XXX: to detect this, we should choose a member that is never set
+ * before initialization of the ND structure itself. We formaly used
+ * the linkmtu member, which was not suitable because it could be
+ * initialized via "ifconfig mtu".
+ */
+ if (ND.basereachable)
return;
ND.linkmtu = ifindex2ifnet[ifp->if_index]->if_mtu;