get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1525146/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1525146,
    "url": "http://patchwork.ozlabs.org/api/patches/1525146/",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/20210907080524.27862-1-dceara@redhat.com/",
    "project": {
        "id": 47,
        "url": "http://patchwork.ozlabs.org/api/projects/47/",
        "name": "Open vSwitch",
        "link_name": "openvswitch",
        "list_id": "ovs-dev.openvswitch.org",
        "list_email": "ovs-dev@openvswitch.org",
        "web_url": "http://openvswitch.org/",
        "scm_url": "git@github.com:openvswitch/ovs.git",
        "webscm_url": "https://github.com/openvswitch/ovs",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20210907080524.27862-1-dceara@redhat.com>",
    "list_archive_url": null,
    "date": "2021-09-07T08:05:24",
    "name": "[ovs-dev] datapath: handle DNAT tuple collision",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "bbe2ba7d0ecea9d4749631e5b2e2b1cb980c4903",
    "submitter": {
        "id": 76591,
        "url": "http://patchwork.ozlabs.org/api/people/76591/",
        "name": "Dumitru Ceara",
        "email": "dceara@redhat.com"
    },
    "delegate": {
        "id": 57772,
        "url": "http://patchwork.ozlabs.org/api/users/57772/",
        "username": "imaximets",
        "first_name": "Ilya",
        "last_name": "Maximets",
        "email": "i.maximets@samsung.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/20210907080524.27862-1-dceara@redhat.com/mbox/",
    "series": [
        {
            "id": 261228,
            "url": "http://patchwork.ozlabs.org/api/series/261228/",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=261228",
            "date": "2021-09-07T08:05:24",
            "name": "[ovs-dev] datapath: handle DNAT tuple collision",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/261228/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1525146/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/1525146/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ovs-dev-bounces@openvswitch.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "dev@openvswitch.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "ovs-dev@lists.linuxfoundation.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=MlW52DiH;\n\tdkim-atps=neutral",
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=140.211.166.133; helo=smtp2.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)",
            "smtp1.osuosl.org (amavisd-new);\n dkim=pass (1024-bit key) header.d=redhat.com",
            "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com"
        ],
        "Received": [
            "from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4H3dB110sVz9sW8\n\tfor <incoming@patchwork.ozlabs.org>; Tue,  7 Sep 2021 18:05:44 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp2.osuosl.org (Postfix) with ESMTP id 9D9F8404C6;\n\tTue,  7 Sep 2021 08:05:42 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n\tby localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id LMBkMYZpN7Ge; Tue,  7 Sep 2021 08:05:41 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp2.osuosl.org (Postfix) with ESMTPS id B294D40294;\n\tTue,  7 Sep 2021 08:05:40 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 8EBB1C000F;\n\tTue,  7 Sep 2021 08:05:40 +0000 (UTC)",
            "from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 3E15BC000D\n for <dev@openvswitch.org>; Tue,  7 Sep 2021 08:05:39 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id 1F5C081DAB\n for <dev@openvswitch.org>; Tue,  7 Sep 2021 08:05:39 +0000 (UTC)",
            "from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id 1Hmt3tF9GrXA for <dev@openvswitch.org>;\n Tue,  7 Sep 2021 08:05:38 +0000 (UTC)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [216.205.24.124])\n by smtp1.osuosl.org (Postfix) with ESMTPS id E7EB981D9F\n for <dev@openvswitch.org>; Tue,  7 Sep 2021 08:05:37 +0000 (UTC)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-159-WJteRAmONxiDFywQxvxgcA-1; Tue, 07 Sep 2021 04:05:32 -0400",
            "from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com\n [10.5.11.15])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ECC81107ACCA;\n Tue,  7 Sep 2021 08:05:30 +0000 (UTC)",
            "from dceara.remote.csb (unknown [10.39.193.233])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 47EC95D6A8;\n Tue,  7 Sep 2021 08:05:29 +0000 (UTC)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.8.0",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1631001936;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=AWbWf+Q+ZLbYJ4+fIyCY9da4tFMTtK8Poj12xd9tXuY=;\n b=MlW52DiHRCXJoAVnAcedSlHd04NjH4ibMONJ7M4yPD+WGxlzNmvjKJ1LO8CqIKpBbd+3PG\n 2qsZ34/We/U/nN2ZO5awy/N4x1ORcx6qDshHjSIEgCiWMvIkYCmP4T0M+DJAm73C7Hc1RI\n CJXNMZJNZPtEesC2IODkjJDgbUVTlfs=",
        "X-MC-Unique": "WJteRAmONxiDFywQxvxgcA-1",
        "From": "Dumitru Ceara <dceara@redhat.com>",
        "To": "dev@openvswitch.org",
        "Date": "Tue,  7 Sep 2021 10:05:24 +0200",
        "Message-Id": "<20210907080524.27862-1-dceara@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Cc": "i.maximets@ovn.org",
        "Subject": "[ovs-dev] [PATCH] datapath: handle DNAT tuple collision",
        "X-BeenThere": "ovs-dev@openvswitch.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "<ovs-dev.openvswitch.org>",
        "List-Unsubscribe": "<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>",
        "List-Archive": "<http://mail.openvswitch.org/pipermail/ovs-dev/>",
        "List-Post": "<mailto:ovs-dev@openvswitch.org>",
        "List-Help": "<mailto:ovs-dev-request@openvswitch.org?subject=help>",
        "List-Subscribe": "<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ovs-dev-bounces@openvswitch.org",
        "Sender": "\"dev\" <ovs-dev-bounces@openvswitch.org>"
    },
    "content": "Upstream commit:\n    commit 8aa7b526dc0b5dbf40c1b834d76a667ad672a410\n    Author: Dumitru Ceara <dceara@redhat.com>\n    Date:   Wed Oct 7 17:48:03 2020 +0200\n\n    openvswitch: handle DNAT tuple collision\n\n    With multiple DNAT rules it's possible that after destination\n    translation the resulting tuples collide.\n\n    For example, two openvswitch flows:\n    nw_dst=10.0.0.10,tp_dst=10, actions=ct(commit,table=2,nat(dst=20.0.0.1:20))\n    nw_dst=10.0.0.20,tp_dst=10, actions=ct(commit,table=2,nat(dst=20.0.0.1:20))\n\n    Assuming two TCP clients initiating the following connections:\n    10.0.0.10:5000->10.0.0.10:10\n    10.0.0.10:5000->10.0.0.20:10\n\n    Both tuples would translate to 10.0.0.10:5000->20.0.0.1:20 causing\n    nf_conntrack_confirm() to fail because of tuple collision.\n\n    Netfilter handles this case by allocating a null binding for SNAT at\n    egress by default.  Perform the same operation in openvswitch for DNAT\n    if no explicit SNAT is requested by the user and allocate a null binding\n    for SNAT for packets in the \"original\" direction.\n\n    Reported-at: https://bugzilla.redhat.com/1877128\n    Suggested-by: Florian Westphal <fw@strlen.de>\n    Fixes: 05752523e565 (\"openvswitch: Interface with NAT.\")\n    Signed-off-by: Dumitru Ceara <dceara@redhat.com>\n    Signed-off-by: Jakub Kicinski <kuba@kernel.org>\n\nFixes: f8f97cdce9ad (\"datapath: Interface with NAT.\")\nSigned-off-by: Dumitru Ceara <dceara@redhat.com>\n---\n datapath/conntrack.c | 22 +++++++++++++---------\n 1 file changed, 13 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/datapath/conntrack.c b/datapath/conntrack.c\nindex 50b4d7bd6aa0..fc268aeae95a 100644\n--- a/datapath/conntrack.c\n+++ b/datapath/conntrack.c\n@@ -978,15 +978,19 @@ static int ovs_ct_nat(struct net *net, struct sw_flow_key *key,\n \t}\n \terr = ovs_ct_nat_execute(skb, ct, ctinfo, &info->range, maniptype);\n \n-\tif (err == NF_ACCEPT &&\n-\t    ct->status & IPS_SRC_NAT && ct->status & IPS_DST_NAT) {\n-\t\tif (maniptype == NF_NAT_MANIP_SRC)\n-\t\t\tmaniptype = NF_NAT_MANIP_DST;\n-\t\telse\n-\t\t\tmaniptype = NF_NAT_MANIP_SRC;\n-\n-\t\terr = ovs_ct_nat_execute(skb, ct, ctinfo, &info->range,\n-\t\t\t\t\t maniptype);\n+\tif (err == NF_ACCEPT && ct->status & IPS_DST_NAT) {\n+\t\tif (ct->status & IPS_SRC_NAT) {\n+\t\t\tif (maniptype == NF_NAT_MANIP_SRC)\n+\t\t\t\tmaniptype = NF_NAT_MANIP_DST;\n+\t\t\telse\n+\t\t\t\tmaniptype = NF_NAT_MANIP_SRC;\n+\n+\t\t\terr = ovs_ct_nat_execute(skb, ct, ctinfo, &info->range,\n+\t\t\t\t\t\t maniptype);\n+\t\t} else if (CTINFO2DIR(ctinfo) == IP_CT_DIR_ORIGINAL) {\n+\t\t\terr = ovs_ct_nat_execute(skb, ct, ctinfo, NULL,\n+\t\t\t\t\t\t NF_NAT_MANIP_SRC);\n+\t\t}\n \t}\n \n \t/* Mark NAT done if successful and update the flow key. */\n",
    "prefixes": [
        "ovs-dev"
    ]
}