From patchwork Wed Aug 19 19:47:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Dykstra X-Patchwork-Id: 31666 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 71B2BB708B for ; Thu, 20 Aug 2009 05:47:53 +1000 (EST) Received: by ozlabs.org (Postfix) id 61890DDD0C; Thu, 20 Aug 2009 05:47:53 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 01112DDD04 for ; Thu, 20 Aug 2009 05:47:52 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752979AbZHSTro (ORCPT ); Wed, 19 Aug 2009 15:47:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752961AbZHSTro (ORCPT ); Wed, 19 Aug 2009 15:47:44 -0400 Received: from rv-out-0506.google.com ([209.85.198.233]:53307 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752853AbZHSTrn (ORCPT ); Wed, 19 Aug 2009 15:47:43 -0400 Received: by rv-out-0506.google.com with SMTP id f6so1364698rvb.1 for ; Wed, 19 Aug 2009 12:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=GLTEY42aAQJO0q/GgtcMikUT3FKDQmnpP8S/+OMgRdc=; b=kJjDz3v/KOOO82ATL/CjtoS1ZOtYg8meQxEEQd6LHxy2ja5d/efjgHfBt+yBM8rjri Q88++g38wWjxxmUMZxSZkYcmuqATueFODdix1feIInxF6IIVMiFF7G7jK/R/PqG+fpnQ pc2BVmMpKAXWNHU12lHDkuriohGrWR3SVKqGU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=VcW7TAMrpOfwof5wmBvTHlYVYSI2wHMeHVWHfJoYqnEZinQjfMNgD0rTEkkA/Pj8vY ME74szlM2YuvJVmkzeswIu3X4vngGD9uF92HObDybMjVZP3zkvkLxwm7VGfTkRLMz5Wp bmoe40XheZROKs7wSBQHu9ypi6iMDUSrQaJRo= Received: by 10.141.18.5 with SMTP id v5mr2214407rvi.254.1250711265266; Wed, 19 Aug 2009 12:47:45 -0700 (PDT) Received: from ?192.168.221.201? ([24.118.80.156]) by mx.google.com with ESMTPS id k41sm418715rvb.37.2009.08.19.12.47.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 19 Aug 2009 12:47:44 -0700 (PDT) Subject: [PATCH net-next-2.6] tcp: Remove redundant copy of MD5 authentication key From: John Dykstra To: netdev Cc: Stephen Hemminger Date: Wed, 19 Aug 2009 19:47:41 +0000 Message-Id: <1250711261.7166.8.camel@Maple> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Stephen, you might want to review this, since you use MD5 authentication. --- Remove the copy of the MD5 authentication key from tcp_check_req(). This key has already been copied by tcp_v4_syn_recv_sock() or tcp_v6_syn_recv_sock(). Signed-off-by: John Dykstra --- net/ipv4/tcp_minisocks.c | 23 ----------------------- 1 files changed, 0 insertions(+), 23 deletions(-) diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index f8d67cc..6c8b422 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -657,29 +657,6 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, child = inet_csk(sk)->icsk_af_ops->syn_recv_sock(sk, skb, req, NULL); if (child == NULL) goto listen_overflow; -#ifdef CONFIG_TCP_MD5SIG - else { - /* Copy over the MD5 key from the original socket */ - struct tcp_md5sig_key *key; - struct tcp_sock *tp = tcp_sk(sk); - key = tp->af_specific->md5_lookup(sk, child); - if (key != NULL) { - /* - * We're using one, so create a matching key on the - * newsk structure. If we fail to get memory then we - * end up not copying the key across. Shucks. - */ - char *newkey = kmemdup(key->key, key->keylen, - GFP_ATOMIC); - if (newkey) { - if (!tcp_alloc_md5sig_pool()) - BUG(); - tp->af_specific->md5_add(child, child, newkey, - key->keylen); - } - } - } -#endif inet_csk_reqsk_queue_unlink(sk, req, prev); inet_csk_reqsk_queue_removed(sk, req);