diff options
Diffstat (limited to 'net/ipv4/tcp_minisocks.c')
-rw-r--r-- | net/ipv4/tcp_minisocks.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index f8d67ccc64f3..e48c37d74d77 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -322,7 +322,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) | |||
322 | if (key != NULL) { | 322 | if (key != NULL) { |
323 | memcpy(&tcptw->tw_md5_key, key->key, key->keylen); | 323 | memcpy(&tcptw->tw_md5_key, key->key, key->keylen); |
324 | tcptw->tw_md5_keylen = key->keylen; | 324 | tcptw->tw_md5_keylen = key->keylen; |
325 | if (tcp_alloc_md5sig_pool() == NULL) | 325 | if (tcp_alloc_md5sig_pool(sk) == NULL) |
326 | BUG(); | 326 | BUG(); |
327 | } | 327 | } |
328 | } while (0); | 328 | } while (0); |
@@ -657,29 +657,6 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, | |||
657 | child = inet_csk(sk)->icsk_af_ops->syn_recv_sock(sk, skb, req, NULL); | 657 | child = inet_csk(sk)->icsk_af_ops->syn_recv_sock(sk, skb, req, NULL); |
658 | if (child == NULL) | 658 | if (child == NULL) |
659 | goto listen_overflow; | 659 | goto listen_overflow; |
660 | #ifdef CONFIG_TCP_MD5SIG | ||
661 | else { | ||
662 | /* Copy over the MD5 key from the original socket */ | ||
663 | struct tcp_md5sig_key *key; | ||
664 | struct tcp_sock *tp = tcp_sk(sk); | ||
665 | key = tp->af_specific->md5_lookup(sk, child); | ||
666 | if (key != NULL) { | ||
667 | /* | ||
668 | * We're using one, so create a matching key on the | ||
669 | * newsk structure. If we fail to get memory then we | ||
670 | * end up not copying the key across. Shucks. | ||
671 | */ | ||
672 | char *newkey = kmemdup(key->key, key->keylen, | ||
673 | GFP_ATOMIC); | ||
674 | if (newkey) { | ||
675 | if (!tcp_alloc_md5sig_pool()) | ||
676 | BUG(); | ||
677 | tp->af_specific->md5_add(child, child, newkey, | ||
678 | key->keylen); | ||
679 | } | ||
680 | } | ||
681 | } | ||
682 | #endif | ||
683 | 660 | ||
684 | inet_csk_reqsk_queue_unlink(sk, req, prev); | 661 | inet_csk_reqsk_queue_unlink(sk, req, prev); |
685 | inet_csk_reqsk_queue_removed(sk, req); | 662 | inet_csk_reqsk_queue_removed(sk, req); |