Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3327734ybc; Mon, 18 Nov 2019 13:23:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxFyT60NmCx9MjdxWCyT1gjZ3xMGdVXRJLQ3kt9RK3dqWsrGu+oY5ePWlP4klyge0fGatxo X-Received: by 2002:adf:fe0c:: with SMTP id n12mr32493744wrr.174.1574112198477; Mon, 18 Nov 2019 13:23:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574112198; cv=none; d=google.com; s=arc-20160816; b=U/dRx2RgQxNwwTGEiVbLMY/rETCzhPCAqGH8sBbQG+BBZnI7hXTFvGWyg41HbD0aeW jNNJQ+0xvUXMk+aRBXBvaRMhUrSjF6tJEYNfGqmzgklUpAarKDMQ0kuUF1px2Y0i1W95 KjOkXV+wHx2RH6f7GUYxebjdbiNmqxZbEwJmRu0SPzMIskbQxjzkRiA85fVO0jj0iQf5 W9JUALHNiMnkJ1RbcBN008MH1PFNpatVzK5gttG1KXEhaVJx9sSBDPmL25bY+WRrCHlP s7nNl4Mi2aI4+5rkuoxzVAtOZGQj7eA0OM9Twv/MaUerZ3IxYEXO6REPccLOoAD8hJum v8Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=QO4lehuxy6RLC/M2Uonk83EBzWJAxoHvNtM3xVNrxjo=; b=SBIcmgCgQgpQ4vda3Dd7MzLFAHH9V3FLwLKFkuUJaWGjN4A5mJCgXeH+u1vEHYA5nW DA2t/aO91hRKvlk1wy+fN/IHbi7MPGZL4vJ7hc3ksv0agjo7ij5Ns4aUXglcbu8r+rw9 yRrtKJJnTJNNYRRhkja4u8Qu3FB0TZ71rLg0Y6ewr9KGmYavJfIuGW/K9yAQWI0+7cVB pyYmcR7goQFJjYRKXgpvU+iQ0jA7D1eeLahs7axT0ag8f/nHE7D8+tY0esnqfCV3iAR6 AXvQtYALRtufmsv3obLNaoUlfXMu73xuIGuM9xBgD3tzp2HPxmkEtiyUbqywi4gInZ1r QFUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fWaHUwDb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si14446221edf.232.2019.11.18.13.22.54; Mon, 18 Nov 2019 13:23:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fWaHUwDb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726983AbfKRVTi (ORCPT + 99 others); Mon, 18 Nov 2019 16:19:38 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:44850 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726664AbfKRVTi (ORCPT ); Mon, 18 Nov 2019 16:19:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574111976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QO4lehuxy6RLC/M2Uonk83EBzWJAxoHvNtM3xVNrxjo=; b=fWaHUwDbgySIRbP0F/xFKyqIy59NkE3SOdzvCZiOkgquqIKsVEFCnjf8PawyiF4hnctt7I gpFTJ/VYWuoruMdccodlnmRy+/LLCiYizMYUXTr7osINBo9J2CIgDz0rAslsTh2WXP51B+ EEJvCqJoXejK25qq8Miz0BU1o59rQco= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-231-PShu_lh4P7OwHtveNvv70g-1; Mon, 18 Nov 2019 16:19:33 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C6DAA8E8041; Mon, 18 Nov 2019 21:19:31 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.127]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 05A6860BE1; Mon, 18 Nov 2019 21:19:29 +0000 (UTC) From: Aaron Conole To: Nicolas Dichtel Cc: netdev@vger.kernel.org, Pravin B Shelar , "David S . Miller" , Jamal Hadi Salim , Cong Wang , Jiri Pirko , dev@openvswitch.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net 1/2] openvswitch: support asymmetric conntrack References: <20191108210714.12426-1-aconole@redhat.com> Date: Mon, 18 Nov 2019 16:19:29 -0500 In-Reply-To: (Nicolas Dichtel's message of "Tue, 12 Nov 2019 09:52:45 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: PShu_lh4P7OwHtveNvv70g-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Nicolas Dichtel writes: > Le 08/11/2019 =C3=A0 22:07, Aaron Conole a =C3=A9crit=C2=A0: >> The openvswitch module shares a common conntrack and NAT infrastructure >> exposed via netfilter. It's possible that a packet needs both SNAT and >> DNAT manipulation, due to e.g. tuple collision. Netfilter can support >> this because it runs through the NAT table twice - once on ingress and >> again after egress. The openvswitch module doesn't have such capability= . >>=20 >> Like netfilter hook infrastructure, we should run through NAT twice to >> keep the symmetry. >>=20 >> Fixes: 05752523e565 ("openvswitch: Interface with NAT.") >> Signed-off-by: Aaron Conole > In this case, ovs_ct_find_existing() won't be able to find the > conntrack, right? vswitchd normally won't allow both actions to get programmed. Even the kernel module won't allow it, so this really will only happen when the connection gets established via the nf_hook path, and then needs to be processed via openvswitch. In those cases, the tuple lookup should be correct, because the nf_nat table should contain the correct tuple data, and the skbuff should have the correct tuples in the packet data to begin with. > Inverting the tuple to find the conntrack doesn't work anymore with doubl= e NAT. > Am I wrong? I think since the packet was double-NAT on the way out (via nf_hook path), then the incoming reply will have the correct NAT tuples and the lookup will happen just fine. Just that during processing, both transformations aren't applied. Makes sense? > Regards, > Nicolas