diff options
author | kp <kp@FreeBSD.org> | 2017-03-18 01:37:20 +0000 |
---|---|---|
committer | Luiz Souza <luiz@netgate.com> | 2017-07-20 21:40:07 -0500 |
commit | 58c80ef49e7d2276893b1e36154089f460b21b17 (patch) | |
tree | ee4d8e1ca9da9680f0f46722815c0518eb9de978 | |
parent | a7cecbc334327f818b22d598d92809ac54d4b8f0 (diff) | |
download | FreeBSD-src-58c80ef49e7d2276893b1e36154089f460b21b17.zip FreeBSD-src-58c80ef49e7d2276893b1e36154089f460b21b17.tar.gz |
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
(cherry picked from commit de11bb5bbebf0d952add4eb58f826f8e0de73671)
-rw-r--r-- | sys/netpfil/pf/pf_ioctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 5672c78..4060e11 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -3816,12 +3816,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(); |