<slangasek> stgraber: do you know a proper way to programmatically get a list 
of all network interfaces on a system, including those that are currently down? 
 http://linux.die.net/man/7/netdevice documents that SIOCGIFCONF doesn't 
include down interfaces, and recommends /proc/net/dev instead
<stgraber> slangasek: I usually iterate through /sys/class/net which works fine 
if you just want a list or want physical interface related kind of information. 
If you need to query the interface configuration, then you need getifaddrs and 
it's a whole other kind of worm (also, some most IPv6 info is also in /proc, 
but ipv4 isn't... yay for consistency)
<slangasek> stgraber: context is whoopsie trying to get a mac address to use as 
a system identifier; this shouldn't be dependent on network interfaces being up
<stgraber> slangasek: /sys/class/net/*/address will get you that
<stgraber> slangasek: if you want to make sure you've got an ethernet device 
(and therefore a MAC), check that /type == 1 too

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1328285

Title:
  can not find hardware address

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1328285/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to