Connection state of interfaces is detected in two ways on FreeBSD. AF_LINK interfaces: stats->ifi_link_state == LINK_STATE_UP AF_INET ones: ifa->ifa_flags & IFF_RUNNING && addrVal.scope != RT_SCOPE_LINK && addrVal.scope != RT_SCOPE_NOWHERE While the first one is correct (even if I don't think we should check for the link-layer connection, as we need the network one - anyway, it's being overwritten, so it's fine), the AF_INET interface uses IFF_RUNNING which on FreeBSD is a driver reserved value (and is mostly set when the driver is loaded). The consequence of this is that the interface, if it has an IP set, is detected as connected. Instead, ioctl() should be used to get a reliable state. Reproducible: Always
Created attachment 71701 [details] Fix to the bug. I'm attaching a patch which fixes the issue checking for the IFM_ACTIVE flag (just like ifconfig and dhclient do).
SVN commit 1299926 by jstamp: Fix link state awareness on FreeBSD Thanks to Alberto Villa for the report and patch. M +6 -1 bsdbackend.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1299926
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I will be closing this bug.