diff options
author | kp <kp@FreeBSD.org> | 2017-03-18 01:37:20 +0000 |
---|---|---|
committer | Luiz Souza <luiz@netgate.com> | 2017-07-17 19:21:04 -0500 |
commit | 9bea8915eb13bccca707a134eadcb1dd82eac4dc (patch) | |
tree | eae777ec8168f5f17f958fcb310612ecb81b9a31 | |
parent | 59d32cb1534a80f7a00afd01d7593e74f634f3dc (diff) | |
download | FreeBSD-src-9bea8915eb13bccca707a134eadcb1dd82eac4dc.zip FreeBSD-src-9bea8915eb13bccca707a134eadcb1dd82eac4dc.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(); |