Re: bonding: cannot remove certain named devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-Mitch

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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux