get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 818035,
    "url": "http://patchwork.ozlabs.org/api/patches/818035/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170925032941.14586-7-tom@quantonium.net/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170925032941.14586-7-tom@quantonium.net>",
    "list_archive_url": null,
    "date": "2017-09-25T03:29:35",
    "name": "[v3,net-next,06/12] gtp: Use goto for exceptions in gtp_udp_encap_recv funcs",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "c39f59d8e6fe0091c2bb8cfd65c4aaaea3dc58ca",
    "submitter": {
        "id": 72064,
        "url": "http://patchwork.ozlabs.org/api/people/72064/?format=api",
        "name": "Tom Herbert",
        "email": "tom@quantonium.net"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170925032941.14586-7-tom@quantonium.net/mbox/",
    "series": [
        {
            "id": 4865,
            "url": "http://patchwork.ozlabs.org/api/series/4865/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4865",
            "date": "2017-09-25T03:29:29",
            "name": "gtp: Additional feature support - Part I",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/4865/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/818035/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/818035/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=quantonium-net.20150623.gappssmtp.com\n\theader.i=@quantonium-net.20150623.gappssmtp.com\n\theader.b=\"Lh/CRKEw\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y0qNC0czJz9t3t\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 25 Sep 2017 13:30:19 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S933009AbdIYDaQ (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 24 Sep 2017 23:30:16 -0400",
            "from mail-pf0-f182.google.com ([209.85.192.182]:52100 \"EHLO\n\tmail-pf0-f182.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S932986AbdIYDaO (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Sun, 24 Sep 2017 23:30:14 -0400",
            "by mail-pf0-f182.google.com with SMTP id b70so3138736pfl.8\n\tfor <netdev@vger.kernel.org>; Sun, 24 Sep 2017 20:30:14 -0700 (PDT)",
            "from localhost.localdomain (c-73-162-13-107.hsd1.ca.comcast.net.\n\t[73.162.13.107]) by smtp.gmail.com with ESMTPSA id\n\tj2sm9112907pgn.26.2017.09.24.20.30.12\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 24 Sep 2017 20:30:13 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=quantonium-net.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=M3FXeq2nLYeSn0fU0Ho7wThC1D83EIjbYlgwheu0zTM=;\n\tb=Lh/CRKEwzK/9ZUpWndBR+fm8bGlpdO1nK5d5ZzFzu5f+w+R3V7TWGawVO36X7nfHiD\n\tRKraRjRQzgHXZlJmLvvit2v1lIpYIJ1L0ipCZLmzjoMp1Q8fF9Xm0OTsrwrb/1aHqOTB\n\tUt6RhAQ1j0aV/U31hOv7juTn+8K3DLJwR/8Y2GHbI4BojR0DCw+hiLzcWlwocjUT/0YA\n\tNewIkAFfSDo4WdGAPKKMLiX7Phu/hD2u4O/znc7B7vgOiiAh4oVstJeVba673YcOtlat\n\tZkQBfwR6EU8ebblZmX5L1R7wVl25qviHjPNaNevfh0+X3PUftOd8ozGeUdwYOMvae4lG\n\tIsmQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=M3FXeq2nLYeSn0fU0Ho7wThC1D83EIjbYlgwheu0zTM=;\n\tb=pE4Gz7NPZL+g+FYi/LvwvDRgj7V2RZ43Ofs4tDfDyfpP7/JLdPJraJ/ATJ/UOAEBps\n\tSZdaQDZ+l2s4SFN5a8s3UkS8kD+KsnsOyyKE27gDMmtXiduz2vcseoh8lc1ss0DFTyw8\n\tVsiJMYtv7ZYalUyLqIQIWyOlsw6xCvUHLhSqhfcuBpJ8g3tPt8Yt0DnEuGmjIsx4QQxH\n\tNeM3vBpk3lkUmGO8LgwFpS5P/ovuBQlmkty7fY8nIwTYCW45cG03BBlfeG6WPi6tLxZ/\n\tJeV7Ee7r4KroSbfLsxX0jQa4T578c3J9Njt7o2ia9+vLXzE0VdSEXVTY0Qci17X0RtPb\n\tbaGQ==",
        "X-Gm-Message-State": "AHPjjUhjhgJIRbbIChNXEi61GD5MPvKn1wKf7QJOgYp+nE/+JZa3/zyQ\n\tyeMlOhf4uQgQRvJksaEsPA5PzXRF",
        "X-Google-Smtp-Source": "AOwi7QDwWGA0EN3feX9iVKt/b8iGgcN9HNz2GGIbSRZL/fKE8OzoSXs6j3DDb5cXtd5mwyXpR8b19w==",
        "X-Received": "by 10.84.252.144 with SMTP id y16mr6418958pll.113.1506310213937; \n\tSun, 24 Sep 2017 20:30:13 -0700 (PDT)",
        "From": "Tom Herbert <tom@quantonium.net>",
        "To": "davem@davemloft.net",
        "Cc": "pablo@netfilter.org, laforge@gnumonks.org, aschultz@tpip.net,\n\tnetdev@vger.kernel.org, rohit@quantonium.net,\n\tTom Herbert <tom@quantonium.net>",
        "Subject": "[PATCH v3 net-next 06/12] gtp: Use goto for exceptions in\n\tgtp_udp_encap_recv funcs",
        "Date": "Sun, 24 Sep 2017 20:29:35 -0700",
        "Message-Id": "<20170925032941.14586-7-tom@quantonium.net>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20170925032941.14586-1-tom@quantonium.net>",
        "References": "<20170925032941.14586-1-tom@quantonium.net>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "Consolidate return logic to make it easier to extend.\n\nSigned-off-by: Tom Herbert <tom@quantonium.net>\n---\n drivers/net/gtp.c | 26 +++++++++++++++++---------\n 1 file changed, 17 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c\nindex f2aac5d01143..00e5ea5cb935 100644\n--- a/drivers/net/gtp.c\n+++ b/drivers/net/gtp.c\n@@ -234,23 +234,27 @@ static int gtp0_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb)\n \tstruct pdp_ctx *pctx;\n \n \tif (!pskb_may_pull(skb, hdrlen))\n-\t\treturn -1;\n+\t\tgoto drop;\n \n \tgtp0 = (struct gtp0_header *)(skb->data + sizeof(struct udphdr));\n \n \tif ((gtp0->flags >> 5) != GTP_V0)\n-\t\treturn 1;\n+\t\tgoto pass;\n \n \tif (gtp0->type != GTP_TPDU)\n-\t\treturn 1;\n+\t\tgoto pass;\n \n \tpctx = gtp0_pdp_find(gtp, be64_to_cpu(gtp0->tid));\n \tif (!pctx) {\n \t\tnetdev_dbg(gtp->dev, \"No PDP ctx to decap skb=%p\\n\", skb);\n-\t\treturn 1;\n+\t\tgoto pass;\n \t}\n \n \treturn gtp_rx(pctx, skb, hdrlen, gtp->role);\n+drop:\n+\treturn -1;\n+pass:\n+\treturn 1;\n }\n \n static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb)\n@@ -261,15 +265,15 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb)\n \tstruct pdp_ctx *pctx;\n \n \tif (!pskb_may_pull(skb, hdrlen))\n-\t\treturn -1;\n+\t\tgoto drop;\n \n \tgtp1 = (struct gtp1_header *)(skb->data + sizeof(struct udphdr));\n \n \tif ((gtp1->flags >> 5) != GTP_V1)\n-\t\treturn 1;\n+\t\tgoto pass;\n \n \tif (gtp1->type != GTP_TPDU)\n-\t\treturn 1;\n+\t\tgoto pass;\n \n \t/* From 29.060: \"This field shall be present if and only if any one or\n \t * more of the S, PN and E flags are set.\".\n@@ -282,17 +286,21 @@ static int gtp1u_udp_encap_recv(struct gtp_dev *gtp, struct sk_buff *skb)\n \n \t/* Make sure the header is larger enough, including extensions. */\n \tif (!pskb_may_pull(skb, hdrlen))\n-\t\treturn -1;\n+\t\tgoto drop;\n \n \tgtp1 = (struct gtp1_header *)(skb->data + sizeof(struct udphdr));\n \n \tpctx = gtp1_pdp_find(gtp, ntohl(gtp1->tid));\n \tif (!pctx) {\n \t\tnetdev_dbg(gtp->dev, \"No PDP ctx to decap skb=%p\\n\", skb);\n-\t\treturn 1;\n+\t\tgoto drop;\n \t}\n \n \treturn gtp_rx(pctx, skb, hdrlen, gtp->role);\n+drop:\n+\treturn -1;\n+pass:\n+\treturn 1;\n }\n \n static void gtp_encap_destroy(struct sock *sk)\n",
    "prefixes": [
        "v3",
        "net-next",
        "06/12"
    ]
}