lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110430112817.GD2658@psychotron.orion>
Date:	Sat, 30 Apr 2011 13:28:17 +0200
From:	Jiri Pirko <jpirko@...hat.com>
To:	Michał Mirosław <mirqus@...il.com>
Cc:	netdev@...r.kernel.org, davem@...emloft.net, xemul@...nvz.org
Subject: Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from
 veth_newlink()

Fri, Apr 22, 2011 at 11:43:10AM CEST, mirqus@...il.com wrote:
>2011/1/24 Jiri Pirko <jpirko@...hat.com>:
>> The code is not needed because tb[IFLA_IFNAME] is already
>> processed in rtnl_newlink(). Remove this redundancy.
>>
>> Signed-off-by: Jiri Pirko <jpirko@...hat.com>
>
>Hi. This patch broke creation of veth devices. Reverting it fixes the issue.

Sorry for troubles.

For net-next-2.6 this is fixed by:
http://patchwork.ozlabs.org/patch/93498/

For net-2.6 I suggest to revert this patch:

Subject: [PATCH net-2.6] Revert: veth: remove unneeded ifname code from veth_newlink()

84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743 caused regression on veth
creation. This patch reverts the original one.

Signed-off-by: Jiri Pirko <jpirko@...hat.com>
---
 drivers/net/veth.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 2de9b90..3b99f64 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -403,6 +403,17 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
 	if (tb[IFLA_ADDRESS] == NULL)
 		random_ether_addr(dev->dev_addr);
 
+	if (tb[IFLA_IFNAME])
+		nla_strlcpy(dev->name, tb[IFLA_IFNAME], IFNAMSIZ);
+	else
+		snprintf(dev->name, IFNAMSIZ, DRV_NAME "%%d");
+
+	if (strchr(dev->name, '%')) {
+		err = dev_alloc_name(dev, dev->name);
+		if (err < 0)
+			goto err_alloc_name;
+	}
+
 	err = register_netdevice(dev);
 	if (err < 0)
 		goto err_register_dev;
@@ -422,6 +433,7 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
 
 err_register_dev:
 	/* nothing to do */
+err_alloc_name:
 err_configure_peer:
 	unregister_netdevice(peer);
 	return err;
-- 
1.7.4.2

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ