From 8bd015a1caf7a0aebe1667c8fe125a12cd3fb7bd Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Thu, 23 Apr 2009 15:56:01 +0000 Subject: [PATCH] As with ifnet_byindex_ref(), don't return IFF_DYING interfaces from ifunit_ref(). ifunit() continues to return them. MFC after: 3 weeks --- sys/net/if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/if.c b/sys/net/if.c index 991f8808ff0..5c2e22420f8 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1799,7 +1799,8 @@ ifunit_ref(const char *name) IFNET_RLOCK(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (strncmp(name, ifp->if_xname, IFNAMSIZ) == 0) + if (strncmp(name, ifp->if_xname, IFNAMSIZ) == 0 && + !(ifp->if_flags & IFF_DYING)) break; } if (ifp != NULL)