[Qt-interest] QNetworkInterface::allInterfaces does not return interfaces without an IP address?
Jeroen De Wachter
jeroen.dewachter at barco.com
Fri Jul 31 14:08:32 CEST 2009
Hello,
I've been testing some things regarding QNetworkInterface and I've
noticed that when I call QNetworkInterface::allInterfaces on a system
that does not have IPv6 support, only the interfaces that are up are
returned.
When I enable IPv6 support in my uClibc-based toolchain (but not in the
kernel), different calls are used and I do get all interfaces and all
their addresses.
This seems due to the way QNetworkInterface gets the interface names and
interface information in qnetworkinterface_unix.cpp
I still need to look further into why this happens exactly (lots of
#ifdef in there), but I wanted to check if anyone else has seen this
issue.
Also, I wanted to ask, if a Linux system is detected, why doesn't Qt use
a more standardized way of doing things? ifconfig parses
the /proc/dev/net file, for instance, while the ip command is using the
netlink interface. (though I guess there would need to be a fallback for
the netlink stuff... Qt will likely run on older kernels that don't
support it.)
I'm working with Qt 4.5.1, by the way. Don't shoot me if this has been
dramatically altered in 4.5.2 or the git repository...
Kind regards,
Jeroen
Software Design Engineer
Barco N.V.
DISCLAIMER:
Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you.
More information about the Qt-interest-old
mailing list