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-next>] [day] [month] [year] [list]
Message-Id: <5358d1a70002df7a00005df100005bf3a00002a40d3b@amlmta037.auone-net.jp>
Date:	Thu, 24 Apr 2014 17:56:06 +0900
From:	Kusanagi Kouichi <slash@...auone-net.jp>
To:	netdev@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] veth: Allow a peer to be up at creation time

Currently, a veth peer cannot be up at creation time.

# ip link add type veth peer up
RTNETLINK answers: Transport endpoint is not connected

Signed-off-by: Kusanagi Kouichi <slash@...auone-net.jp>
---
 drivers/net/veth.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index b4a10bc..aa87afc 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -373,10 +373,6 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
 
 	netif_carrier_off(peer);
 
-	err = rtnl_configure_link(peer, ifmp);
-	if (err < 0)
-		goto err_configure_peer;
-
 	/*
 	 * register dev last
 	 *
@@ -407,11 +403,16 @@ static int veth_newlink(struct net *src_net, struct net_device *dev,
 
 	priv = netdev_priv(peer);
 	rcu_assign_pointer(priv->peer, dev);
+
+	err = rtnl_configure_link(peer, ifmp);
+	if (err < 0)
+		goto err_configure_peer;
+
 	return 0;
 
-err_register_dev:
-	/* nothing to do */
 err_configure_peer:
+	unregister_netdevice(dev);
+err_register_dev:
 	unregister_netdevice(peer);
 	return err;
 
-- 
2.0.0.rc0

--
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