get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 807996,
    "url": "http://patchwork.ozlabs.org/api/patches/807996/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170831013312.29142-2-colona@arista.com/",
    "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": "<20170831013312.29142-2-colona@arista.com>",
    "list_archive_url": null,
    "date": "2017-08-31T01:33:11",
    "name": "[net-next,v4,1/2] inet_diag: allow protocols to provide additional data",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "d397bb5467db3f675f9c6a909910d5bd4f79c8f8",
    "submitter": {
        "id": 65664,
        "url": "http://patchwork.ozlabs.org/api/people/65664/?format=api",
        "name": "Ivan Delalande",
        "email": "colona@arista.com"
    },
    "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/20170831013312.29142-2-colona@arista.com/mbox/",
    "series": [
        {
            "id": 730,
            "url": "http://patchwork.ozlabs.org/api/series/730/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=730",
            "date": "2017-08-31T01:33:12",
            "name": "report TCP MD5 signing keys and addresses",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/730/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/807996/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/807996/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 (1024-bit key;\n\tunprotected) header.d=arista.com header.i=@arista.com\n\theader.b=\"bKKUBAQ1\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjPyv0QX4z9s7G\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 11:33:27 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751191AbdHaBdO (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 30 Aug 2017 21:33:14 -0400",
            "from prod-mx.aristanetworks.com ([162.210.130.12]:54315 \"EHLO\n\tprod-mx.aristanetworks.com\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1750774AbdHaBdN (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 30 Aug 2017 21:33:13 -0400",
            "from prod-mx.aristanetworks.com (localhost [127.0.0.1])\n\tby prod-mx.aristanetworks.com (Postfix) with ESMTP id 795B095D3;\n\tWed, 30 Aug 2017 18:33:12 -0700 (PDT)",
            "from visor.sjc.aristanetworks.com\n\t(manila-157.sjc.aristanetworks.com [172.20.135.157])\n\tby prod-mx.aristanetworks.com (Postfix) with ESMTP id 6BFB895D4;\n\tWed, 30 Aug 2017 18:33:12 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com;\n\ts=AristaCom; t=1504143192;\n\tbh=ZsB3IGO9Hhixa04bIe3dTc6KI4vOKa/4jWaIlGsrQDo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References;\n\tb=bKKUBAQ1rOQgPBwUAeffw4BNZfrI01tskJ3e+6yGdYNvaF3kpjRMyrI81KlTuyBfF\n\ts4NapXvGwPX5khwiNDpe62MyyFZX7bII2N4Aiy0M7bSluahAee38TKpKemiOazo2kF\n\tGZmgSU8F0jXq91spE+A+pbPjsK/CIqGeDExUULds=",
        "From": "Ivan Delalande <colona@arista.com>",
        "To": "David Miller <davem@davemloft.net>",
        "Cc": "Eric Dumazet <eric.dumazet@gmail.com>, netdev@vger.kernel.org,\n\tIvan Delalande <colona@arista.com>",
        "Subject": "[PATCH net-next v4 1/2] inet_diag: allow protocols to provide\n\tadditional data",
        "Date": "Wed, 30 Aug 2017 18:33:11 -0700",
        "Message-Id": "<20170831013312.29142-2-colona@arista.com>",
        "X-Mailer": "git-send-email 2.14.1",
        "In-Reply-To": "<20170831013312.29142-1-colona@arista.com>",
        "References": "<20170831013312.29142-1-colona@arista.com>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "Extend inet_diag_handler to allow individual protocols to report\nadditional data on INET_DIAG_INFO through idiag_get_aux. The size\ncan be dynamic and is computed by idiag_get_aux_size.\n\nSigned-off-by: Ivan Delalande <colona@arista.com>\n---\n include/linux/inet_diag.h |  7 +++++++\n net/ipv4/inet_diag.c      | 22 ++++++++++++++++++----\n 2 files changed, 25 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h\nindex 65da430e260f..ee251c585854 100644\n--- a/include/linux/inet_diag.h\n+++ b/include/linux/inet_diag.h\n@@ -25,6 +25,13 @@ struct inet_diag_handler {\n \t\t\t\t\t  struct inet_diag_msg *r,\n \t\t\t\t\t  void *info);\n \n+\tint\t\t(*idiag_get_aux)(struct sock *sk,\n+\t\t\t\t\t bool net_admin,\n+\t\t\t\t\t struct sk_buff *skb);\n+\n+\tsize_t\t\t(*idiag_get_aux_size)(struct sock *sk,\n+\t\t\t\t\t      bool net_admin);\n+\n \tint\t\t(*destroy)(struct sk_buff *in_skb,\n \t\t\t\t   const struct inet_diag_req_v2 *req);\n \ndiff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c\nindex 67325d5832d7..cb7012d1720f 100644\n--- a/net/ipv4/inet_diag.c\n+++ b/net/ipv4/inet_diag.c\n@@ -93,8 +93,17 @@ void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk)\n }\n EXPORT_SYMBOL_GPL(inet_diag_msg_common_fill);\n \n-static size_t inet_sk_attr_size(void)\n+static size_t inet_sk_attr_size(struct sock *sk,\n+\t\t\t\tconst struct inet_diag_req_v2 *req,\n+\t\t\t\tbool net_admin)\n {\n+\tconst struct inet_diag_handler *handler;\n+\tsize_t aux = 0;\n+\n+\thandler = inet_diag_table[req->sdiag_protocol];\n+\tif (handler && handler->idiag_get_aux_size)\n+\t\taux = handler->idiag_get_aux_size(sk, net_admin);\n+\n \treturn\t  nla_total_size(sizeof(struct tcp_info))\n \t\t+ nla_total_size(1) /* INET_DIAG_SHUTDOWN */\n \t\t+ nla_total_size(1) /* INET_DIAG_TOS */\n@@ -105,6 +114,7 @@ static size_t inet_sk_attr_size(void)\n \t\t+ nla_total_size(SK_MEMINFO_VARS * sizeof(u32))\n \t\t+ nla_total_size(TCP_CA_NAME_MAX)\n \t\t+ nla_total_size(sizeof(struct tcpvegas_info))\n+\t\t+ nla_total_size(aux)\n \t\t+ 64;\n }\n \n@@ -260,6 +270,10 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,\n \n \thandler->idiag_get_info(sk, r, info);\n \n+\tif (ext & (1 << (INET_DIAG_INFO - 1)) && handler->idiag_get_aux)\n+\t\tif (handler->idiag_get_aux(sk, net_admin, skb) < 0)\n+\t\t\tgoto errout;\n+\n \tif (sk->sk_state < TCP_TIME_WAIT) {\n \t\tunion tcp_cc_info info;\n \t\tsize_t sz = 0;\n@@ -449,6 +463,7 @@ int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,\n \t\t\t    const struct nlmsghdr *nlh,\n \t\t\t    const struct inet_diag_req_v2 *req)\n {\n+\tbool net_admin = netlink_net_capable(in_skb, CAP_NET_ADMIN);\n \tstruct net *net = sock_net(in_skb->sk);\n \tstruct sk_buff *rep;\n \tstruct sock *sk;\n@@ -458,7 +473,7 @@ int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,\n \tif (IS_ERR(sk))\n \t\treturn PTR_ERR(sk);\n \n-\trep = nlmsg_new(inet_sk_attr_size(), GFP_KERNEL);\n+\trep = nlmsg_new(inet_sk_attr_size(sk, req, net_admin), GFP_KERNEL);\n \tif (!rep) {\n \t\terr = -ENOMEM;\n \t\tgoto out;\n@@ -467,8 +482,7 @@ int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,\n \terr = sk_diag_fill(sk, rep, req,\n \t\t\t   sk_user_ns(NETLINK_CB(in_skb).sk),\n \t\t\t   NETLINK_CB(in_skb).portid,\n-\t\t\t   nlh->nlmsg_seq, 0, nlh,\n-\t\t\t   netlink_net_capable(in_skb, CAP_NET_ADMIN));\n+\t\t\t   nlh->nlmsg_seq, 0, nlh, net_admin);\n \tif (err < 0) {\n \t\tWARN_ON(err == -EMSGSIZE);\n \t\tnlmsg_free(rep);\n",
    "prefixes": [
        "net-next",
        "v4",
        "1/2"
    ]
}