As with ifnet_byindex_ref(), don't return IFF_DYING interfaces from

ifunit_ref().  ifunit() continues to return them.

MFC after:	3 weeks
This commit is contained in:
Robert Watson 2009-04-23 15:56:01 +00:00
parent 6064c5d362
commit 8bd015a1ca
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191424

View File

@ -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)