Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/818596/?format=api
{ "id": 818596, "url": "http://patchwork.ozlabs.org/api/patches/818596/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170926115843.12013-4-fw@strlen.de/", "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": "<20170926115843.12013-4-fw@strlen.de>", "list_archive_url": null, "date": "2017-09-26T11:58:42", "name": "[net-next,v4,3/4] rtnetlink: add helpers to dump netnsid information", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "bdca25308f431d769351fb7ba22b91d436695017", "submitter": { "id": 1025, "url": "http://patchwork.ozlabs.org/api/people/1025/?format=api", "name": "Florian Westphal", "email": "fw@strlen.de" }, "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/20170926115843.12013-4-fw@strlen.de/mbox/", "series": [ { "id": 5115, "url": "http://patchwork.ozlabs.org/api/series/5115/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=5115", "date": "2017-09-26T11:58:39", "name": "rtnetlink: preparation patches for further rtnl lock pushdown/removal", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/5115/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/818596/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/818596/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>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y1fcH6WWcz9tXf\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 26 Sep 2017 21:58:39 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S965086AbdIZL6h (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 26 Sep 2017 07:58:37 -0400", "from Chamillionaire.breakpoint.cc ([146.0.238.67]:58792 \"EHLO\n\tChamillionaire.breakpoint.cc\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S964827AbdIZL6g (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Tue, 26 Sep 2017 07:58:36 -0400", "from fw by Chamillionaire.breakpoint.cc with local (Exim 4.84_2)\n\t(envelope-from <fw@breakpoint.cc>)\n\tid 1dwoSC-0007B6-7v; Tue, 26 Sep 2017 13:55:08 +0200" ], "From": "Florian Westphal <fw@strlen.de>", "To": "<netdev@vger.kernel.org>", "Cc": "Florian Westphal <fw@strlen.de>", "Subject": "[PATCH net-next v4 3/4] rtnetlink: add helpers to dump netnsid\n\tinformation", "Date": "Tue, 26 Sep 2017 13:58:42 +0200", "Message-Id": "<20170926115843.12013-4-fw@strlen.de>", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170926115843.12013-1-fw@strlen.de>", "References": "<20170926115843.12013-1-fw@strlen.de>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "Reviewed-by: David Ahern <dsahern@gmail.com>\nSigned-off-by: Florian Westphal <fw@strlen.de>\n---\n No changes in v4.\n\n net/core/rtnetlink.c | 30 +++++++++++++++++++-----------\n 1 file changed, 19 insertions(+), 11 deletions(-)", "diff": "diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c\nindex d504e78cd01f..d524609c587c 100644\n--- a/net/core/rtnetlink.c\n+++ b/net/core/rtnetlink.c\n@@ -1362,6 +1362,23 @@ static int nla_put_iflink(struct sk_buff *skb, const struct net_device *dev)\n \treturn nla_put_u32(skb, IFLA_LINK, ifindex);\n }\n \n+static int rtnl_fill_link_netnsid(struct sk_buff *skb,\n+\t\t\t\t const struct net_device *dev)\n+{\n+\tif (dev->rtnl_link_ops && dev->rtnl_link_ops->get_link_net) {\n+\t\tstruct net *link_net = dev->rtnl_link_ops->get_link_net(dev);\n+\n+\t\tif (!net_eq(dev_net(dev), link_net)) {\n+\t\t\tint id = peernet2id_alloc(dev_net(dev), link_net);\n+\n+\t\t\tif (nla_put_s32(skb, IFLA_LINK_NETNSID, id))\n+\t\t\t\treturn -EMSGSIZE;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,\n \t\t\t int type, u32 pid, u32 seq, u32 change,\n \t\t\t unsigned int flags, u32 ext_filter_mask,\n@@ -1451,17 +1468,8 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,\n \t\t\tgoto nla_put_failure;\n \t}\n \n-\tif (dev->rtnl_link_ops &&\n-\t dev->rtnl_link_ops->get_link_net) {\n-\t\tstruct net *link_net = dev->rtnl_link_ops->get_link_net(dev);\n-\n-\t\tif (!net_eq(dev_net(dev), link_net)) {\n-\t\t\tint id = peernet2id_alloc(dev_net(dev), link_net);\n-\n-\t\t\tif (nla_put_s32(skb, IFLA_LINK_NETNSID, id))\n-\t\t\t\tgoto nla_put_failure;\n-\t\t}\n-\t}\n+\tif (rtnl_fill_link_netnsid(skb, dev))\n+\t\tgoto nla_put_failure;\n \n \tif (!(af_spec = nla_nest_start(skb, IFLA_AF_SPEC)))\n \t\tgoto nla_put_failure;\n", "prefixes": [ "net-next", "v4", "3/4" ] }