get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 817706,
    "url": "http://patchwork.ozlabs.org/api/patches/817706/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/5aaba993111c3609b309e8a0edb6da2146b08c9c.1506114055.git.pabeni@redhat.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": "<5aaba993111c3609b309e8a0edb6da2146b08c9c.1506114055.git.pabeni@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-22T21:06:33",
    "name": "[RFC,09/11] route: add ipv4/6 helpers to do partial route lookup vs local dst",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "0b63f495b49592adf3964e9017eaaa94f403cf40",
    "submitter": {
        "id": 67312,
        "url": "http://patchwork.ozlabs.org/api/people/67312/?format=api",
        "name": "Paolo Abeni",
        "email": "pabeni@redhat.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/5aaba993111c3609b309e8a0edb6da2146b08c9c.1506114055.git.pabeni@redhat.com/mbox/",
    "series": [
        {
            "id": 4709,
            "url": "http://patchwork.ozlabs.org/api/series/4709/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4709",
            "date": "2017-09-22T21:06:24",
            "name": "udp: full early demux for unconnected sockets",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/4709/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/817706/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/817706/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>)",
            "ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pabeni@redhat.com"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xzQzC4GKfz9sP1\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 23 Sep 2017 07:07:19 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752759AbdIVVHR (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 22 Sep 2017 17:07:17 -0400",
            "from mx1.redhat.com ([209.132.183.28]:36352 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1752747AbdIVVHP (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tFri, 22 Sep 2017 17:07:15 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id BF062806DA;\n\tFri, 22 Sep 2017 21:07:14 +0000 (UTC)",
            "from dhcppc0.redhat.com (ovpn-116-39.ams2.redhat.com\n\t[10.36.116.39])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 178736292E;\n\tFri, 22 Sep 2017 21:07:12 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com BF062806DA",
        "From": "Paolo Abeni <pabeni@redhat.com>",
        "To": "netdev@vger.kernel.org",
        "Cc": "\"David S. Miller\" <davem@davemloft.net>,\n\tPablo Neira Ayuso <pablo@netfilter.org>, Florian Westphal <fw@strlen.de>,\n\tEric Dumazet <edumazet@google.com>,\n\tHannes Frederic Sowa <hannes@stressinduktion.org>",
        "Subject": "[RFC PATCH 09/11] route: add ipv4/6 helpers to do partial route\n\tlookup vs local dst",
        "Date": "Fri, 22 Sep 2017 23:06:33 +0200",
        "Message-Id": "<5aaba993111c3609b309e8a0edb6da2146b08c9c.1506114055.git.pabeni@redhat.com>",
        "In-Reply-To": "<cover.1506114055.git.pabeni@redhat.com>",
        "References": "<cover.1506114055.git.pabeni@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tFri, 22 Sep 2017 21:07:14 +0000 (UTC)",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "For ipv4 also implement the proper source address validation, even\nagainst martian addresses and return an error code accordingly.\n\nWill be used by later patches to perform dst lookup in early\ndemux for unconnected sockets.\n\nSigned-off-by: Paolo Abeni <pabeni@redhat.com>\n---\n include/net/ip6_route.h |  1 +\n include/net/route.h     |  2 ++\n net/ipv4/route.c        | 43 +++++++++++++++++++++++++++++++++++++++++++\n net/ipv6/route.c        | 13 +++++++++++++\n 4 files changed, 59 insertions(+)",
    "diff": "diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h\nindex ee96f402cb75..edb24456a609 100644\n--- a/include/net/ip6_route.h\n+++ b/include/net/ip6_route.h\n@@ -65,6 +65,7 @@ static inline bool rt6_need_strict(const struct in6_addr *daddr)\n \t\t(IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK);\n }\n \n+void ip6_route_try_local_rcu_bh(struct net *net, struct sk_buff *skb);\n void ip6_route_input(struct sk_buff *skb);\n struct dst_entry *ip6_route_input_lookup(struct net *net,\n \t\t\t\t\t struct net_device *dev,\ndiff --git a/include/net/route.h b/include/net/route.h\nindex ec09c3d73581..21927231cc14 100644\n--- a/include/net/route.h\n+++ b/include/net/route.h\n@@ -178,6 +178,8 @@ static inline struct rtable *ip_route_output_gre(struct net *net, struct flowi4\n \n struct rtable *ip_local_route_alloc(struct net_device *dev, unsigned int flags,\n \t\t\t\t    u32 itag, unsigned char type, bool docache);\n+int ip_route_try_local_rcu(struct net *net, struct sk_buff *skb,\n+\t\t\t   const struct iphdr *iph);\n int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src,\n \t\t\t u8 tos, struct net_device *devin);\n int ip_route_input_rcu(struct sk_buff *skb, __be32 dst, __be32 src,\ndiff --git a/net/ipv4/route.c b/net/ipv4/route.c\nindex 515589f1b3d1..84248dd41da6 100644\n--- a/net/ipv4/route.c\n+++ b/net/ipv4/route.c\n@@ -2079,6 +2079,49 @@ out:\treturn err;\n \tgoto out;\n }\n \n+/* try to resolve and set the route for the ingress packet in the local\n+ * destination, looking-up the destination address against the local ones\n+ * and performing source validation\n+ * return an error only if the local look up is successful and validation fails\n+ * Called under RCU\n+ */\n+int ip_route_try_local_rcu(struct net *net, struct sk_buff *skb,\n+\t\t\t   const struct iphdr *iph)\n+{\n+\t__be32 saddr = iph->saddr;\n+\tstruct in_device *in_dev;\n+\tstruct dst_entry *dst;\n+\tint err = -EINVAL;\n+\tu32 itag;\n+\n+\tdst = inet_get_ifaddr_dst_rcu(net, iph->daddr);\n+\tif (!dst)\n+\t\treturn 0;\n+\n+\tin_dev = __in_dev_get_rcu(skb->dev);\n+\tif (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr))\n+\t\tgoto martian_source;\n+\n+\t/* check for zeronet only after successful lookup, so that we don't trip\n+\t * over limited broadcast destination, see ip_route_input_slow()\n+\t */\n+\tif (ipv4_is_zeronet(saddr) || (ipv4_is_loopback(saddr) &&\n+\t\t\t\t       !IN_DEV_NET_ROUTE_LOCALNET(in_dev, net)))\n+\t\tgoto martian_source;\n+\n+\terr = fib_validate_source(skb, saddr, iph->daddr, iph->tos, 0, skb->dev,\n+\t\t\t\t  in_dev, &itag);\n+\tif (err < 0)\n+\t\tgoto martian_source;\n+\n+\tskb_dst_set_noref(skb, dst);\n+\treturn 0;\n+\n+martian_source:\n+\tip_handle_martian_source(skb->dev, in_dev, skb, iph->daddr, iph->saddr);\n+\treturn err;\n+}\n+\n int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr,\n \t\t\t u8 tos, struct net_device *dev)\n {\ndiff --git a/net/ipv6/route.c b/net/ipv6/route.c\nindex 26cc9f483b6d..d957e30b1cbe 100644\n--- a/net/ipv6/route.c\n+++ b/net/ipv6/route.c\n@@ -1283,6 +1283,19 @@ void ip6_route_input(struct sk_buff *skb)\n \tskb_dst_set(skb, ip6_route_input_lookup(net, skb->dev, &fl6, flags));\n }\n \n+/* try to resolve and set the route for the ingress packet in the local\n+ * destination\n+ * Called under RCU\n+ */\n+void ip6_route_try_local_rcu_bh(struct net *net, struct sk_buff *skb)\n+{\n+\tstruct dst_entry *dst;\n+\n+\tdst = inet6_get_ifaddr_dst_rcu_bh(net, &ipv6_hdr(skb)->daddr);\n+\tif (dst)\n+\t\tskb_dst_set_noref(skb, dst);\n+}\n+\n static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table,\n \t\t\t\t\t     struct flowi6 *fl6, int flags)\n {\n",
    "prefixes": [
        "RFC",
        "09/11"
    ]
}