When "jail -c vnet" request fails, the current code actually creates and

leaves behind an orphaned vnet.  This change ensures that such vnets get
released.

This change affects only options VIMAGE builds.

Submitted by:	jamie
Discussed with:	bz
Approved by:	re (rwatson), julian (mentor)
MFC after:	3 days
This commit is contained in:
Marko Zec 2009-08-24 10:16:19 +00:00
parent 52db6805ea
commit 0cb8b6a9b7

View file

@ -2456,7 +2456,7 @@ prison_deref(struct prison *pr, int flags)
sx_downgrade(&allprison_lock);
#ifdef VIMAGE
if (pr->pr_flags & PR_VNET)
if (pr->pr_vnet != ppr->pr_vnet)
vnet_destroy(pr->pr_vnet);
#endif
if (pr->pr_root != NULL) {