mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
ifnet: Restore curvnet earlier
This improves readability a little. As a side effect, a redundant CURVNET_RESTORE is removed. No functional change intended. Reviewed by: glebius MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45595 (cherry picked from commit ef4f4a44d9134ddadede0e2e6e658d0688c5ab3c)
This commit is contained in:
parent
0b875c0a0c
commit
2d89af7ac5
1 changed files with 1 additions and 4 deletions
|
|
@ -1345,8 +1345,8 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, char *ifname, int jid)
|
|||
/* XXX Lock interfaces to avoid races. */
|
||||
CURVNET_SET_QUIET(pr->pr_vnet);
|
||||
difp = ifunit(ifname);
|
||||
CURVNET_RESTORE();
|
||||
if (difp != NULL) {
|
||||
CURVNET_RESTORE();
|
||||
prison_free(pr);
|
||||
return (EEXIST);
|
||||
}
|
||||
|
|
@ -1356,16 +1356,13 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, char *ifname, int jid)
|
|||
shutdown = VNET_IS_SHUTTING_DOWN(ifp->if_vnet);
|
||||
if (shutdown) {
|
||||
sx_xunlock(&ifnet_detach_sxlock);
|
||||
CURVNET_RESTORE();
|
||||
prison_free(pr);
|
||||
return (EBUSY);
|
||||
}
|
||||
CURVNET_RESTORE();
|
||||
|
||||
found = if_unlink_ifnet(ifp, true);
|
||||
if (! found) {
|
||||
sx_xunlock(&ifnet_detach_sxlock);
|
||||
CURVNET_RESTORE();
|
||||
prison_free(pr);
|
||||
return (ENODEV);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue