Message ID | 20201012132635.078248798@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=uWP8=DT=vger.kernel.org=stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1246C433E7 for <stable@archiver.kernel.org>; Mon, 12 Oct 2020 13:44:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B24C822260 for <stable@archiver.kernel.org>; Mon, 12 Oct 2020 13:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510248; bh=kEXTnfRial0Iy2Rh+fkaI/D+lfjwelUdeomIUAaV/WQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BrvV1JB6PkEDsypoSeCC2Z8t/pPZHxfa6MP4gn1BiquXDKB6yLpTK1mhuCzgscqi8 F3A/OZITf9j5WnPjjNVreoFTt52o/+6rlJiwmQKWsbk3QKlISf6pyYCBFp5NLLAQKc 4/q95a0Bs8Xgp6+lKdUDlif/+XZqrXE37WoNPQLk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726780AbgJLNoI (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 12 Oct 2020 09:44:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:48296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389195AbgJLNnG (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 12 Oct 2020 09:43:06 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 690402087E; Mon, 12 Oct 2020 13:43:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510184; bh=kEXTnfRial0Iy2Rh+fkaI/D+lfjwelUdeomIUAaV/WQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k05FDc+2H8ORmFwtKYQ4v8qFZlGE2Ln0OyrcymEa0vficlPir0CxiMZ6K2xoSEsrQ OS7WKY2lGd6iE45tHwpiqNesMK4YRzRprtKxbUgeqR6IiE1Z9LzilwQ7YeimYfRHEl kjWzZlAVJx8fNYvrHAV/9jGIhRC3dwgvuY5PV7OQ= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Florian Westphal <fw@strlen.de>, Dumitru Ceara <dceara@redhat.com>, Jakub Kicinski <kuba@kernel.org> Subject: [PATCH 5.4 46/85] openvswitch: handle DNAT tuple collision Date: Mon, 12 Oct 2020 15:27:09 +0200 Message-Id: <20201012132635.078248798@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132632.846779148@linuxfoundation.org> References: <20201012132632.846779148@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c @@ -905,15 +905,19 @@ static int ovs_ct_nat(struct net *net, s } err = ovs_ct_nat_execute(skb, ct, ctinfo, &info->range, maniptype); - if (err == NF_ACCEPT && - ct->status & IPS_SRC_NAT && ct->status & IPS_DST_NAT) { - if (maniptype == NF_NAT_MANIP_SRC) - maniptype = NF_NAT_MANIP_DST; - else - maniptype = NF_NAT_MANIP_SRC; + if (err == NF_ACCEPT && ct->status & IPS_DST_NAT) { + if (ct->status & IPS_SRC_NAT) { + if (maniptype == NF_NAT_MANIP_SRC) + maniptype = NF_NAT_MANIP_DST; + else + maniptype = NF_NAT_MANIP_SRC; - err = ovs_ct_nat_execute(skb, ct, ctinfo, &info->range, - maniptype); + err = ovs_ct_nat_execute(skb, ct, ctinfo, &info->range, + maniptype); + } else if (CTINFO2DIR(ctinfo) == IP_CT_DIR_ORIGINAL) { + err = ovs_ct_nat_execute(skb, ct, ctinfo, NULL, + NF_NAT_MANIP_SRC); + } } /* Mark NAT done if successful and update the flow key. */