get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50751,
    "url": "http://patches.dpdk.org/api/patches/50751/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190302104251.32565-6-hyonkim@cisco.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20190302104251.32565-6-hyonkim@cisco.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190302104251.32565-6-hyonkim@cisco.com",
    "date": "2019-03-02T10:42:43",
    "name": "[v2,05/13] net/enic: check for unsupported flow item types",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fc55c51a71d0ce736fe14dc039fbf01a3d00b346",
    "submitter": {
        "id": 948,
        "url": "http://patches.dpdk.org/api/people/948/?format=api",
        "name": "Hyong Youb Kim (hyonkim)",
        "email": "hyonkim@cisco.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190302104251.32565-6-hyonkim@cisco.com/mbox/",
    "series": [
        {
            "id": 3613,
            "url": "http://patches.dpdk.org/api/series/3613/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3613",
            "date": "2019-03-02T10:42:38",
            "name": "net/enic: 19.05 updates",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/3613/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50751/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/50751/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E1BC4378B;\n\tSat,  2 Mar 2019 11:44:14 +0100 (CET)",
            "from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73])\n\tby dpdk.org (Postfix) with ESMTP id 777742C38;\n\tSat,  2 Mar 2019 11:44:12 +0100 (CET)",
            "from alln-core-5.cisco.com ([173.36.13.138])\n\tby rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Mar 2019 10:44:11 +0000",
            "from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48])\n\tby alln-core-5.cisco.com (8.15.2/8.15.2) with ESMTP id x22AiB2T029802;\n\tSat, 2 Mar 2019 10:44:11 GMT",
            "by cisco.com (Postfix, from userid 508933)\n\tid 7811820F2001; Sat,  2 Mar 2019 02:44:11 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=cisco.com; i=@cisco.com; l=2755; q=dns/txt; s=iport;\n\tt=1551523452; x=1552733052;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=he4ktedDHvic2UrYgYx+RP6VxHvgT2Ka5BFBiaSTAos=;\n\tb=fUJbGbhjufVp876TjRcrY6THb+J2GMUVpJraVovGFIHqmLQfdOS33T3W\n\treH6STFGJ27oUuqsyFiVdUe47yuDJiw8QtYdilBiUwbJyvO+4en4+7JD1\n\tK1vKjVwsAB3dNnAQH02f1PnxnclLNiens/v5z4gTczr8ef4Gw3VS3YKyC k=;",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,431,1544486400\"; d=\"scan'208\";a=\"530643131\"",
        "From": "Hyong Youb Kim <hyonkim@cisco.com>",
        "To": "Ferruh Yigit <ferruh.yigit@intel.com>",
        "Cc": "dev@dpdk.org, John Daley <johndale@cisco.com>,\n\tHyong Youb Kim <hyonkim@cisco.com>, stable@dpdk.org",
        "Date": "Sat,  2 Mar 2019 02:42:43 -0800",
        "Message-Id": "<20190302104251.32565-6-hyonkim@cisco.com>",
        "X-Mailer": "git-send-email 2.16.2",
        "In-Reply-To": "<20190302104251.32565-1-hyonkim@cisco.com>",
        "References": "<20190302104251.32565-1-hyonkim@cisco.com>",
        "X-Outbound-SMTP-Client": "10.193.184.48, savbu-usnic-a.cisco.com",
        "X-Outbound-Node": "alln-core-5.cisco.com",
        "Subject": "[dpdk-dev] [PATCH v2 05/13] net/enic: check for unsupported flow\n\titem types",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Currently a pattern with an unsupported item type causes segfault,\nbecause the flow handler is using the type as an array index without\nchecking bounds. Add an explicit check for unsupported item types and\navoid out-of-bound accesses.\n\nFixes: 6ced137607d0 (\"net/enic: flow API for NICs with advanced filters enabled\")\nCc: stable@dpdk.org\n\nSigned-off-by: Hyong Youb Kim <hyonkim@cisco.com>\nReviewed-by: John Daley <johndale@cisco.com>\n---\n drivers/net/enic/enic_flow.c | 18 +++++++++++++++---\n 1 file changed, 15 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c\nindex e12a6ec73..c60476c8c 100644\n--- a/drivers/net/enic/enic_flow.c\n+++ b/drivers/net/enic/enic_flow.c\n@@ -40,6 +40,8 @@ struct enic_items {\n struct enic_filter_cap {\n \t/** list of valid items and their handlers and attributes. */\n \tconst struct enic_items *item_info;\n+\t/* Max type in the above list, used to detect unsupported types */\n+\tenum rte_flow_item_type max_item_type;\n };\n \n /* functions for copying flow actions into enic actions */\n@@ -257,12 +259,15 @@ static const struct enic_items enic_items_v3[] = {\n static const struct enic_filter_cap enic_filter_cap[] = {\n \t[FILTER_IPV4_5TUPLE] = {\n \t\t.item_info = enic_items_v1,\n+\t\t.max_item_type = RTE_FLOW_ITEM_TYPE_TCP,\n \t},\n \t[FILTER_USNIC_IP] = {\n \t\t.item_info = enic_items_v2,\n+\t\t.max_item_type = RTE_FLOW_ITEM_TYPE_VXLAN,\n \t},\n \t[FILTER_DPDK_1] = {\n \t\t.item_info = enic_items_v3,\n+\t\t.max_item_type = RTE_FLOW_ITEM_TYPE_VXLAN,\n \t},\n };\n \n@@ -946,7 +951,7 @@ item_stacking_valid(enum rte_flow_item_type prev_item,\n  */\n static int\n enic_copy_filter(const struct rte_flow_item pattern[],\n-\t\t const struct enic_items *items_info,\n+\t\t const struct enic_filter_cap *cap,\n \t\t struct filter_v2 *enic_filter,\n \t\t struct rte_flow_error *error)\n {\n@@ -969,7 +974,14 @@ enic_copy_filter(const struct rte_flow_item pattern[],\n \t\tif (item->type == RTE_FLOW_ITEM_TYPE_VOID)\n \t\t\tcontinue;\n \n-\t\titem_info = &items_info[item->type];\n+\t\titem_info = &cap->item_info[item->type];\n+\t\tif (item->type > cap->max_item_type ||\n+\t\t    item_info->copy_item == NULL) {\n+\t\t\trte_flow_error_set(error, ENOTSUP,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\tNULL, \"Unsupported item.\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n \n \t\t/* check to see if item stacking is valid */\n \t\tif (!item_stacking_valid(prev_item, item_info, is_first_item))\n@@ -1423,7 +1435,7 @@ enic_flow_parse(struct rte_eth_dev *dev,\n \t\treturn -rte_errno;\n \t}\n \tenic_filter->type = enic->flow_filter_mode;\n-\tret = enic_copy_filter(pattern, enic_filter_cap->item_info,\n+\tret = enic_copy_filter(pattern, enic_filter_cap,\n \t\t\t\t       enic_filter, error);\n \treturn ret;\n }\n",
    "prefixes": [
        "v2",
        "05/13"
    ]
}