diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index e4c1e51b18c1..d3b691f3a9e8 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -594,7 +594,8 @@ static unsigned int tcp_syn_options(struct sock *sk, struct sk_buff *skb, | |||
594 | 594 | ||
595 | *md5 = NULL; | 595 | *md5 = NULL; |
596 | #ifdef CONFIG_TCP_MD5SIG | 596 | #ifdef CONFIG_TCP_MD5SIG |
597 | if (unlikely(rcu_access_pointer(tp->md5sig_info))) { | 597 | if (static_key_false(&tcp_md5_needed) && |
598 | rcu_access_pointer(tp->md5sig_info)) { | ||
598 | *md5 = tp->af_specific->md5_lookup(sk, sk); | 599 | *md5 = tp->af_specific->md5_lookup(sk, sk); |
599 | if (*md5) { | 600 | if (*md5) { |
600 | opts->options |= OPTION_MD5; | 601 | opts->options |= OPTION_MD5; |
@@ -730,7 +731,8 @@ static unsigned int tcp_established_options(struct sock *sk, struct sk_buff *skb | |||
730 | 731 | ||
731 | *md5 = NULL; | 732 | *md5 = NULL; |
732 | #ifdef CONFIG_TCP_MD5SIG | 733 | #ifdef CONFIG_TCP_MD5SIG |
733 | if (unlikely(rcu_access_pointer(tp->md5sig_info))) { | 734 | if (static_key_false(&tcp_md5_needed) && |
735 | rcu_access_pointer(tp->md5sig_info)) { | ||
734 | *md5 = tp->af_specific->md5_lookup(sk, sk); | 736 | *md5 = tp->af_specific->md5_lookup(sk, sk); |
735 | if (*md5) { | 737 | if (*md5) { |
736 | opts->options |= OPTION_MD5; | 738 | opts->options |= OPTION_MD5; |