diff --git a/include/net/tcp.h b/include/net/tcp.h index a6191053eff28c61cb9cfca32609721445de63a5..110ca98aa3e972ad38fb5ac2092bca6c84903b60 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -2213,11 +2213,20 @@ void clean_acked_data_disable(struct inet_connection_sock *icsk); #if IS_ENABLED(CONFIG_TCP_COMP) extern struct static_key_false tcp_have_comp; bool tcp_syn_comp_enabled(const struct tcp_sock *tp); +void tcp_init_compression(struct sock *sk); +void tcp_cleanup_compression(struct sock *sk); #else static inline bool tcp_syn_comp_enabled(const struct tcp_sock *tp) { return false; } +static inline void tcp_init_compression(struct sock *sk) +{ +} + +static inline void tcp_cleanup_compression(struct sock *sk) +{ +} #endif #endif /* _TCP_H */ diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 14e4872462a792a1659b16d330641997cb02171c..e1a003d8c317575402cd74c1b2daa4cd67b9fcc0 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -470,6 +470,7 @@ void tcp_init_transfer(struct sock *sk, int bpf_op) tcp_init_metrics(sk); tcp_call_bpf(sk, bpf_op, 0, NULL); tcp_init_congestion_control(sk); + tcp_init_compression(sk); tcp_init_buffer_space(sk); } diff --git a/net/ipv4/tcp_comp.c b/net/ipv4/tcp_comp.c index e2bf4fbb4c3ffd5eed07cc6457793afb5e1f1ab3..067d48b72429682917c9fe691287bf8ecaa96a87 100644 --- a/net/ipv4/tcp_comp.c +++ b/net/ipv4/tcp_comp.c @@ -11,3 +11,11 @@ bool tcp_syn_comp_enabled(const struct tcp_sock *tp) { return true; } + +void tcp_init_compression(struct sock *sk) +{ +} + +void tcp_cleanup_compression(struct sock *sk) +{ +} diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 2eb90ed6c01345a8fd7257fa180eece7a538c3ae..eb7f770a6443d3098a33f2bc0d578820d378d924 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -2074,6 +2074,8 @@ void tcp_v4_destroy_sock(struct sock *sk) tcp_cleanup_congestion_control(sk); + tcp_cleanup_compression(sk); + tcp_cleanup_ulp(sk); /* Cleanup up the write buffer. */