diff options
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index f03d2b0445fd..32fa0de9982a 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -854,7 +854,9 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb) | |||
854 | 854 | ||
855 | #ifdef CONFIG_TCP_MD5SIG | 855 | #ifdef CONFIG_TCP_MD5SIG |
856 | hash_location = tcp_parse_md5sig_option(th); | 856 | hash_location = tcp_parse_md5sig_option(th); |
857 | if (!sk && hash_location) { | 857 | if (sk) { |
858 | key = tcp_v6_md5_do_lookup(sk, &ipv6h->saddr); | ||
859 | } else if (hash_location) { | ||
858 | /* | 860 | /* |
859 | * active side is lost. Try to find listening socket through | 861 | * active side is lost. Try to find listening socket through |
860 | * source port, and then find md5 key through listening socket. | 862 | * source port, and then find md5 key through listening socket. |
@@ -877,8 +879,6 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb) | |||
877 | genhash = tcp_v6_md5_hash_skb(newhash, key, NULL, skb); | 879 | genhash = tcp_v6_md5_hash_skb(newhash, key, NULL, skb); |
878 | if (genhash || memcmp(hash_location, newhash, 16) != 0) | 880 | if (genhash || memcmp(hash_location, newhash, 16) != 0) |
879 | goto release_sk1; | 881 | goto release_sk1; |
880 | } else { | ||
881 | key = sk ? tcp_v6_md5_do_lookup(sk, &ipv6h->saddr) : NULL; | ||
882 | } | 882 | } |
883 | #endif | 883 | #endif |
884 | 884 | ||