netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug handling devices with weird names
@ 2010-07-08 17:08 Martín Ferrari
  2010-07-08 17:27 ` Stephen Hemminger
  0 siblings, 1 reply; 6+ messages in thread
From: Martín Ferrari @ 2010-07-08 17:08 UTC (permalink / raw)
  To: netdev; +Cc: Mathieu Lacage

According to dev_valid_name (net/core/dev.c), a valid device name is
one that doesn't include spaces, slashes, and is not "." or "..". But
if I create a device called "foo:", some operations fail:

# ip link add name foo: type dummy
# ip link list foo:
155: foo:: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN ioctl(SIOCGIFXQLEN)
failed: No such device

    link/ether 92:7f:4d:0d:8f:57 brd ff:ff:ff:ff:ff:ff

Strace reveals that the problem occurs when executing an ioctl:

ioctl(4, SIOCGIFTXQLEN, {ifr_name="foo:", ???}) = -1 ENODEV (No such device)

ifconfig gets completely lost, of course:

$ /sbin/ifconfig foo:
foo:: error fetching interface information: Device not found

ioctl(5, SIOCGIFFLAGS, {ifr_name="foo:", ???}) = -1 ENODEV (No such device)


So, is this fixable or iproute should stop using the ioctl interface?
(dunno if netlink provides everything already)

-- 
Martín Ferrari

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-09 16:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-08 17:08 Bug handling devices with weird names Martín Ferrari
2010-07-08 17:27 ` Stephen Hemminger
2010-07-09 10:04   ` Martín Ferrari
2010-07-09 10:19     ` Eric Dumazet
2010-07-09 15:41       ` Martín Ferrari
2010-07-09 16:14         ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).