Re: bonding: cannot remove certain named devices

From: Mitch Williams
Date: Tue Aug 15 2006 - 16:36:50 EST

On Tue, 15 Aug 2006, Bill Nottingham wrote:

> 2.6.17-rc4+.
> Trivial example:
> # modprobe bonding (creates bond0)
> # ip link set bond0 name "a b"
> # echo "-a b" > /sys/class/net/bonding_masters
> bonding: unable to delete non-existent bond a
> bash: echo: write error: No such device

Yuck. The problem here is the space in the interface name, which the
sysfs code chokes on. The code just does

sscanf(buffer, "%16s", command); /* IFNAMSIZ*/

and goes from there. Because of the space, it only gets the first half of
the interface name.

Suggestions? Do we just omit the sscanf and copy up to the newline (or
EOF)? Should there be another delimiter here?

Are spaces allowed in interface names anyway? I can't believe that
bonding is the only area affected by this.


BTW this will also break if you try to add/remove a slave with a space in
the name through sysfs.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at