mirror of
https://github.com/opnsense/src.git
synced 2026-06-10 17:22:46 -04:00
Similarly to r301505 protect the removal of the ifa from the if_addrhead
by a lock (as well as the check that the list is not empty). Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
b67565942b
commit
d117fd8003
1 changed files with 4 additions and 1 deletions
|
|
@ -1007,11 +1007,14 @@ if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp)
|
|||
ifp->if_addr = NULL;
|
||||
|
||||
/* We can now free link ifaddr. */
|
||||
IF_ADDR_WLOCK(ifp);
|
||||
if (!TAILQ_EMPTY(&ifp->if_addrhead)) {
|
||||
ifa = TAILQ_FIRST(&ifp->if_addrhead);
|
||||
TAILQ_REMOVE(&ifp->if_addrhead, ifa, ifa_link);
|
||||
IF_ADDR_WUNLOCK(ifp);
|
||||
ifa_free(ifa);
|
||||
}
|
||||
} else
|
||||
IF_ADDR_WUNLOCK(ifp);
|
||||
}
|
||||
|
||||
rt_flushifroutes(ifp);
|
||||
|
|
|
|||
Loading…
Reference in a new issue