From patchwork Thu Jun 3 15:45:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 54492 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DBD8EB6ED0 for ; Fri, 4 Jun 2010 01:45:59 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755183Ab0FCPpy (ORCPT ); Thu, 3 Jun 2010 11:45:54 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:35733 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751811Ab0FCPpy (ORCPT ); Thu, 3 Jun 2010 11:45:54 -0400 Received: by wyi11 with SMTP id 11so162826wyi.19 for ; Thu, 03 Jun 2010 08:45:52 -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=nEYWW5F0MBbPRH8Z3iJ6bpsU9ah0CaUYpnZMPHRfgUA=; b=ZgmH1yddUZDYJoWwQVe35qTsblLUOLSC50mN+bFRoeXqKLGh7xuoeCr2XdSCO/8TmU wxM3MqTgO7q1TFAOfrLfySL/bisUU2JywWBo68K6G54lwS/Xnoi0lBmUp8YHXx+oOpjJ uywmAcoG8KSf18YA+jGGVJWj+SCMVpi8r65Gk= 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=J9wZUMrs2D1rVmiRTZkHnMf5AcEneTXYktVwFlUMaKHjm2xT8yqtXDWXxt48Icpb6Z 2hcln3JsGqRbz32UMcmdvXJJVYjfpFpPdv4KWLHyTDGsMAFL075HUXZUJeyLcrVyrmly 336wTagMqv8/8NDZDEr+q5AogNsZ3GPtUGkII= Received: by 10.227.142.13 with SMTP id o13mr9786906wbu.71.1275579950178; Thu, 03 Jun 2010 08:45:50 -0700 (PDT) Received: from [127.0.0.1] ([85.17.35.125]) by mx.google.com with ESMTPS id t70sm147535weq.14.2010.06.03.08.45.49 (version=SSLv3 cipher=RC4-MD5); Thu, 03 Jun 2010 08:45:49 -0700 (PDT) Subject: [PATCH] tcp: use correct net ns in cookie_v4_check() From: Eric Dumazet To: David Miller Cc: netdev Date: Thu, 03 Jun 2010 17:45:47 +0200 Message-ID: <1275579947.2456.80.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Unless I am mistaken, this is a stable candidate. (Found by code review, please double check) Thanks [PATCH] tcp: use correct net ns in cookie_v4_check() Its better to make a route lookup in appropriate namespace. Signed-off-by: Eric Dumazet --- net/ipv4/syncookies.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index 5c24db4..9f6b222 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c @@ -347,7 +347,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, { .sport = th->dest, .dport = th->source } } }; security_req_classify_flow(req, &fl); - if (ip_route_output_key(&init_net, &rt, &fl)) { + if (ip_route_output_key(sock_net(sk), &rt, &fl)) { reqsk_free(req); goto out; }