pf: Fix memory leak on vnet shutdown or unload

Rules are unlinked in shutdown_pf(), so we must call
pf_unload_vnet_purge(), which frees unlinked rules, after that, not
before.

Reviewed by:	eri, bz
Differential Revision:	https://reviews.freebsd.org/D10040
This commit is contained in:
kp 2017-03-18 01:37:20 +00:00
parent 77ef67ae70
commit de11bb5bbe

View File

@ -3766,12 +3766,12 @@ pf_unload_vnet(void)
return;
}
pf_unload_vnet_purge();
PF_RULES_WLOCK();
shutdown_pf();
PF_RULES_WUNLOCK();
pf_unload_vnet_purge();
pf_normalize_cleanup();
PF_RULES_WLOCK();
pfi_cleanup_vnet();