summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-11-10 18:08:43 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-11-10 18:08:43 +0000
commit62a37c2083cf3fd34b99225c5c26ddc85e4c4787 (patch)
tree04a29316424ed913f17905cc5c0496be2dbebf88 /sys
parentdedcf7dabb00172eb049d9c7114d62454caaa2f3 (diff)
Clear ifindex2ifnet[] in if_detach() this is needed because link local
addressing in IPv6 likes to do ifp = ifindex2ifnet[ifindex] without properly checking if the ifindex is valid. As a side-effect this solves parts of PR 5981. Debugged by jsing@. OK jsing@, deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 2892e0e4107..c83b5bbc9b8 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.173 2008/06/12 16:15:05 claudio Exp $ */
+/* $OpenBSD: if.c,v 1.174 2008/11/10 18:08:42 claudio Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -636,6 +636,7 @@ do { \
/* Announce that the interface is gone. */
rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
+ ifindex2ifnet[ifp->if_index] = NULL;
splx(s);
}