[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48173735.5060505@openvz.org>
Date: Tue, 29 Apr 2008 18:56:53 +0400
From: Pavel Emelyanov <xemul@...nvz.org>
To: Jay Vosburgh <fubar@...ibm.com>, David Miller <davem@...emloft.net>
CC: bonding-devel@...ts.sourceforge.net,
Linux Netdev List <netdev@...r.kernel.org>
Subject: [PATCH 2/8][BONDING]: Don't create bondings with % in their names.
Type
# echo '+bond%d' > /sys/class/net/bonding_masters
and get the 'bond%d' device in the ip l l output.
Other drivers do not play such jokes on user :)
Signed-off-by: Pavel Emelyanov <xemul@...nvz.org>
---
drivers/net/bonding/bond_main.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 36121b6..2072910 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4909,6 +4909,10 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond
res = dev_alloc_name(bond_dev, "bond%d");
if (res < 0)
goto out_netdev;
+ } else if (strchr(name, '%')) {
+ res = dev_alloc_name(bond_dev, name);
+ if (res < 0)
+ goto out_netdev;
}
/* bond_init() must be called after dev_alloc_name() (for the
--
1.5.3.4
--
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