From 62a37c2083cf3fd34b99225c5c26ddc85e4c4787 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Mon, 10 Nov 2008 18:08:43 +0000 Subject: 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@ --- sys/net/if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys') 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); } -- cgit v1.2.3