Subject: [PATCH] net: Avoid problems with bonding and device rename

From: Stephen Hemminger <[email-masked]>
Date: Wed, 14 May 2008 17:03:16 -0700

See: http://bugzilla.kernel.org/show_bug.cgi?id=10698

The use of /sys/class/net/bonding_masters was a poor ABI choice
that now we have to live with. Best choice is to just block other
usage of that name.

Signed-off-by: Stephen Hemminger <[email-masked]>

--- a/net/core/dev.c	2008-05-14 16:50:53.000000000 -0700
+++ b/net/core/dev.c	2008-05-14 16:52:25.000000000 -0700
@@ -758,6 +758,9 @@ int dev_valid_name(const char *name)
 		return 0;
 	if (!strcmp(name, ".") || !strcmp(name, ".."))
 		return 0;
+	/* Sigh. need better ABI discipline -- see bond_sysfs */
+	if (!strcmp(name, "bonding_masters"))
+		return 0;
 
 	while (*name) {
 		if (*name == '/' || isspace(*name))