Subject: [PATCH 2/8][BONDING]: Don't create bondings with % in their names.

From: Pavel Emelyanov <[email-masked]>
Date: Tue, 29 Apr 2008 18:56:53 +0400

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 <[email-masked]>

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