Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1164/?format=api
{ "id": 1164, "url": "http://patchwork.ozlabs.org/api/patches/1164/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/48D948E8.6090804@hartkopp.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": "<48D948E8.6090804@hartkopp.net>", "list_archive_url": null, "date": "2008-09-23T19:52:08", "name": "[net-next] : net: remove ifalias on empty given alias", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "0c42ffbbe897769b75bf7bb80fecb13980cb16bf", "submitter": { "id": 454, "url": "http://patchwork.ozlabs.org/api/people/454/?format=api", "name": "Oliver Hartkopp", "email": "oliver@hartkopp.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/48D948E8.6090804@hartkopp.net/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/1164/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1164/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.176.167])\n\tby ozlabs.org (Postfix) with ESMTP id 338E0DE327\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 24 Sep 2008 05:52:14 +1000 (EST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752506AbYIWTwI (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 23 Sep 2008 15:52:08 -0400", "(majordomo@vger.kernel.org) by vger.kernel.org id S1751972AbYIWTwH\n\t(ORCPT <rfc822; netdev-outgoing>); Tue, 23 Sep 2008 15:52:07 -0400", "from mo-p00-ob.rzone.de ([81.169.146.162]:27807 \"EHLO\n\tmo-p00-ob.rzone.de\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750928AbYIWTwG (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Tue, 23 Sep 2008 15:52:06 -0400", "from [192.168.11.10] (p5B22BBFE.dip.t-dialin.net [91.34.187.254])\n\tby post.webmailer.de (klopstock mo19) (RZmta 17.4)\n\twith ESMTP id C05f40k8NHoJEi ; Tue, 23 Sep 2008 21:52:02 +0200 (MEST)\n\t(envelope-from: <oliver@hartkopp.net>)" ], "X-RZG-CLASS-ID": "mo00", "X-RZG-AUTH": ":I2ANY0W6W/eA95XfH/xfO6gOxLxTty/udEMngcJ/VAKW226lDNJVyuYEIzI8Pb0x", "Message-ID": "<48D948E8.6090804@hartkopp.net>", "Date": "Tue, 23 Sep 2008 21:52:08 +0200", "From": "Oliver Hartkopp <oliver@hartkopp.net>", "User-Agent": "Mozilla-Thunderbird 2.0.0.16 (X11/20080724)", "MIME-Version": "1.0", "To": "Stephen Hemminger <shemminger@vyatta.com>", "CC": "David Miller <davem@davemloft.net>, netdev@vger.kernel.org", "Subject": "[PATCH net-next]: net: remove ifalias on empty given alias ", "References": "<20080922174346.2ad15d26@extreme>", "In-Reply-To": "<20080922174346.2ad15d26@extreme>", "Content-Type": "multipart/mixed;\n\tboundary=\"------------050109040009020009060509\"", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "This patch removes the potentially allocated ifalias when the (new) \ngiven alias is empty.\n\nE.g. when setting\n\necho \"\" > /sys/class/net/eth0/ifalias\n\nSigned-off-by: Oliver Hartkopp <oliver@hartkopp.net>\n---\n\nHello Stephen,\n\nthis patch allows to 'remove' or reset the ifalias by giving an empty alias.\nThe patch is tested.\nBtw. ifalias is a nice idea also for CAN bus people to 'name' a given \nCAN bus.\n\nThanks & regards,\nOliver", "diff": "diff --git a/net/core/dev.c b/net/core/dev.c\nindex e913905..a90737f 100644\n--- a/net/core/dev.c\n+++ b/net/core/dev.c\n@@ -967,6 +967,14 @@ int dev_set_alias(struct net_device *dev, const char *alias, size_t len)\n \tif (len >= IFALIASZ)\n \t\treturn -EINVAL;\n \n+\tif (!len) {\n+\t\tif (dev->ifalias) {\n+\t\t\tkfree(dev->ifalias);\n+\t\t\tdev->ifalias = NULL;\n+\t\t}\n+\t\treturn 0;\n+\t}\n+\n \tdev->ifalias = krealloc(dev->ifalias, len+1, GFP_KERNEL);\n \tif (!dev->ifalias)\n \t\treturn -ENOMEM;\n", "prefixes": [ "net-next" ] }