[Interest] QNetworkInterface working differently on Qt5?

Tom Isaacson Tom.Isaacson at navico.com
Wed Dec 2 06:31:01 CET 2015


Did a bit more debugging and it seems that QNetworkInterface:: allAddresses() does return all the IP addresses but QNetworkInterface::addressEntries() only returns 1.

>We have an embedded Linux device setup to get two IP addresses like this:
>
># ifconfig
>eth0      Link encap:Ethernet  HWaddr 00:0E:C2:26:82:76  
>          inet addr:169.254.142.146  Bcast:169.254.255.255  Mask:255.255.0.0
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>eth0:dhcp Link encap:Ethernet  HWaddr 00:0E:C2:26:82:76  
>          inet addr:192.168.0.11  Bcast:192.168.255.255  Mask:255.255.0.0
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>
>Our app uses QNetworkInterface::allInterfaces() then steps through it calling QNetworkInterface::addressEntries() to get the IP addresses. This works fine on >Qt 4.8.2 but since we moved to Qt 5.5.1 we're only getting the zeroconfig address from eth0. Has QNetworkInterface changed in Qt5 or is this a known bug?






More information about the Interest mailing list