diff options
author | bz <bz@FreeBSD.org> | 2016-04-09 10:58:08 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2016-04-09 10:58:08 +0000 |
commit | 55f63f4b6bf72e562fc5960e77787c0c96f525b9 (patch) | |
tree | a54d50c933b200075734b54169b5e865969deed1 /sys/netinet/tcp_subr.c | |
parent | c17351943ca48eae70fe00dae338b6293d6927a0 (diff) | |
download | FreeBSD-src-55f63f4b6bf72e562fc5960e77787c0c96f525b9.zip FreeBSD-src-55f63f4b6bf72e562fc5960e77787c0c96f525b9.tar.gz |
Mfp: r296259
We attach the "counter" to the tcpcbs. Thus don't free the
TCP Fastopen zone before the tcpcbs are gone, as otherwise
the zone won't be empty.
With that it should be safe to destroy the "tfo" zone without
leaking the memory.
PR: 164763
Reviewed by: gnn
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5731
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 33b16ad..417e0d8 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -738,9 +738,6 @@ tcp_destroy(void) { int error; -#ifdef TCP_RFC7413 - tcp_fastopen_destroy(); -#endif tcp_hc_destroy(); syncache_destroy(); tcp_tw_destroy(); @@ -748,6 +745,14 @@ tcp_destroy(void) uma_zdestroy(V_sack_hole_zone); uma_zdestroy(V_tcpcb_zone); +#ifdef TCP_RFC7413 + /* + * Cannot free the zone until all tcpcbs are released as we attach + * the allocations to them. + */ + tcp_fastopen_destroy(); +#endif + error = hhook_head_deregister(V_tcp_hhh[HHOOK_TCP_EST_IN]); if (error != 0) { printf("%s: WARNING: unable to deregister helper hook " |