get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1523004,
    "url": "http://patchwork.ozlabs.org/api/patches/1523004/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/1630489288-3526-1-git-send-email-wenxu@ucloud.cn/",
    "project": {
        "id": 47,
        "url": "http://patchwork.ozlabs.org/api/projects/47/?format=api",
        "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": "<1630489288-3526-1-git-send-email-wenxu@ucloud.cn>",
    "list_archive_url": null,
    "date": "2021-09-01T09:41:27",
    "name": "[ovs-dev,v2,1/2] conntrack: restore the origin port for each round with new address",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "06e24753acb7b5734389e6a16467790ed42752a9",
    "submitter": {
        "id": 67928,
        "url": "http://patchwork.ozlabs.org/api/people/67928/?format=api",
        "name": "wenxu",
        "email": "wenxu@ucloud.cn"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/1630489288-3526-1-git-send-email-wenxu@ucloud.cn/mbox/",
    "series": [
        {
            "id": 260521,
            "url": "http://patchwork.ozlabs.org/api/series/260521/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=260521",
            "date": "2021-09-01T09:41:27",
            "name": "[ovs-dev,v2,1/2] conntrack: restore the origin port for each round with new address",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/260521/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1523004/comments/",
    "check": "fail",
    "checks": "http://patchwork.ozlabs.org/api/patches/1523004/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 spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)",
        "Received": [
            "from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\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 4Gzzbp44w1z9sW8\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  1 Sep 2021 19:41:56 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 4FCD5607AE;\n\tWed,  1 Sep 2021 09:41:53 +0000 (UTC)",
            "from smtp3.osuosl.org ([127.0.0.1])\n\tby localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id MKiJKzUiXf_2; Wed,  1 Sep 2021 09:41:49 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp3.osuosl.org (Postfix) with ESMTPS id A15E1605E1;\n\tWed,  1 Sep 2021 09:41:48 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 6A7A7C001A;\n\tWed,  1 Sep 2021 09:41:48 +0000 (UTC)",
            "from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])\n by lists.linuxfoundation.org (Postfix) with ESMTP id AE2C8C000E\n for <dev@openvswitch.org>; Wed,  1 Sep 2021 09:41:46 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id 9044F401B0\n for <dev@openvswitch.org>; Wed,  1 Sep 2021 09:41:46 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id 7zQom-Ym_Lny for <dev@openvswitch.org>;\n Wed,  1 Sep 2021 09:41:45 +0000 (UTC)",
            "from mail-m2456.qiye.163.com (mail-m2456.qiye.163.com\n [220.194.24.56])\n by smtp2.osuosl.org (Postfix) with ESMTPS id 0399A400F0\n for <dev@openvswitch.org>; Wed,  1 Sep 2021 09:41:44 +0000 (UTC)",
            "from localhost.localdomain (unknown [117.50.0.204])\n by mail-m2456.qiye.163.com (Hmail) with ESMTPA id 961A67002A1;\n Wed,  1 Sep 2021 17:41:28 +0800 (CST)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.8.0",
        "From": "wenxu@ucloud.cn",
        "To": "i.maximets@ovn.org, dlu998@gmail.com, pvalerio@redhat.com,\n aconole@redhat.com",
        "Date": "Wed,  1 Sep 2021 17:41:27 +0800",
        "Message-Id": "<1630489288-3526-1-git-send-email-wenxu@ucloud.cn>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "X-HM-Spam-Status": "e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZCBgUCR5ZQVlLVUtZV1\n kWDxoPAgseWUFZKDYvK1lXWShZQUlCN1dZLVlBSVdZDwkaFQgSH1lBWUMZSUNWTxgdSkhDTUNNSR\n kZVRkRExYaEhckFA4PWVdZFhoPEhUdFFlBWU9LSFVKSktISkxVS1kG",
        "X-HM-Sender-Digest": "e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Pk06Mww6SzMMER4jCS9PKgg3\n VhcaFExVSlVKTUhLT0NCSUNDTENLVTMWGhIXVQweFQMOOw4YFxQOH1UYFUVZV1kSC1lBWUpKTFVO\n S1VLVUlLT1lXWQgBWUFJTk9NNwY+",
        "X-HM-Tid": "0a7ba0bc1fbc8c15kuqt961a67002a1",
        "Cc": "dev@openvswitch.org",
        "Subject": "[ovs-dev] [PATCH v2 1/2] conntrack: restore the origin port for\n\teach round with new address",
        "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>",
        "MIME-Version": "1.0",
        "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": "From: wenxu <wenxu@ucloud.cn>\n\nIt is better to choose the origin select port as current port\nfor each port search round with new address.\n\nSigned-off-by: wenxu <wenxu@ucloud.cn>\n---\n lib/conntrack.c | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/conntrack.c b/lib/conntrack.c\nindex 551c206..2d14205 100644\n--- a/lib/conntrack.c\n+++ b/lib/conntrack.c\n@@ -2412,8 +2412,8 @@ nat_get_unique_tuple(struct conntrack *ct, const struct conn *conn,\n     uint32_t hash = nat_range_hash(conn, ct->hash_basis);\n     bool pat_proto = conn->key.nw_proto == IPPROTO_TCP ||\n                      conn->key.nw_proto == IPPROTO_UDP;\n-    uint16_t min_dport, max_dport, curr_dport;\n-    uint16_t min_sport, max_sport, curr_sport;\n+    uint16_t min_dport, max_dport, curr_dport, orig_dport;\n+    uint16_t min_sport, max_sport, curr_sport, orig_sport;\n \n     min_addr = conn->nat_info->min_addr;\n     max_addr = conn->nat_info->max_addr;\n@@ -2425,9 +2425,9 @@ nat_get_unique_tuple(struct conntrack *ct, const struct conn *conn,\n      * we can stop once we reach it. */\n     guard_addr = curr_addr;\n \n-    set_sport_range(conn->nat_info, &conn->key, hash, &curr_sport,\n+    set_sport_range(conn->nat_info, &conn->key, hash, &orig_sport,\n                     &min_sport, &max_sport);\n-    set_dport_range(conn->nat_info, &conn->key, hash, &curr_dport,\n+    set_dport_range(conn->nat_info, &conn->key, hash, &orig_dport,\n                     &min_dport, &max_dport);\n \n another_round:\n@@ -2443,6 +2443,9 @@ another_round:\n         goto next_addr;\n     }\n \n+    curr_sport = orig_sport;\n+    curr_dport = orig_dport;\n+\n     FOR_EACH_PORT_IN_RANGE(curr_dport, min_dport, max_dport) {\n         nat_conn->rev_key.src.port = htons(curr_dport);\n         FOR_EACH_PORT_IN_RANGE(curr_sport, min_sport, max_sport) {\n",
    "prefixes": [
        "ovs-dev",
        "v2",
        "1/2"
    ]
}