mirror of
https://github.com/opnsense/src.git
synced 2026-04-27 09:06:49 -04:00
After tearing down the interface per-"domain" bits, set the data area
to NULL to avoid it being mis-treated on a possible re-attach but also to get a clean NULL pointer derefence in case of errors due to unexpected race conditions elsewhere in the code, e.g., callouts. Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
c152ba971f
commit
2d5ad99a0d
1 changed files with 3 additions and 1 deletions
|
|
@ -1030,9 +1030,11 @@ if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp)
|
|||
ifp->if_afdata_initialized = 0;
|
||||
IF_AFDATA_UNLOCK(ifp);
|
||||
for (dp = domains; i > 0 && dp; dp = dp->dom_next) {
|
||||
if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family])
|
||||
if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family]) {
|
||||
(*dp->dom_ifdetach)(ifp,
|
||||
ifp->if_afdata[dp->dom_family]);
|
||||
ifp->if_afdata[dp->dom_family] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue