diff options
author | simokawa <simokawa@FreeBSD.org> | 2001-02-20 10:23:25 +0000 |
---|---|---|
committer | simokawa <simokawa@FreeBSD.org> | 2001-02-20 10:23:25 +0000 |
commit | 6d1f53999c24631267a7934463fc7e3e2cd3b233 (patch) | |
tree | 1166af700796fdb330557b30c7fe2fee906feb24 /sys/netinet6 | |
parent | 4dc4c3edc5a2de76acb7546afecc41bc9275e193 (diff) | |
download | FreeBSD-src-6d1f53999c24631267a7934463fc7e3e2cd3b233.zip FreeBSD-src-6d1f53999c24631267a7934463fc7e3e2cd3b233.tar.gz |
Better detection of duplicated initialization.
Obtained from: KAME
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/nd6.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 3731585..4298ce2 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; |