Connectivity dbus property is LIMITED when it should be NONE
I noticed this problem with NM 1.14.6, so I installed the master version from git (1.17.0, or more specific 9a71d7d2) to see if it can still be reproduced and it's what I'm using (on an openSUSE Tumbleweed system) to report this issue.
If I boot my laptop with no dock station connected (so no wired interface) and wifi disabled in NM I just have a lo and wlp2s0 interfaces, as seen here:
> ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: wlp2s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
> ip route
>
NM reports the State on DBus as 20 (NM_STATE_DISCONNECTED) and Connectivity as 3 (NM_CONNECTIVITY_LIMITED). Shouldn't Connectivity be 1 (NM_CONNECTIVITY_NONE)?
> dbus-send --system --print-reply --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.state
method return time=1552320171.601509 sender=:1.9 -> destination=:1.96 serial=1704 reply_serial=2
uint32 20
> dbus-send --system --print-reply --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.CheckConnectivity
method return time=1552320179.463833 sender=:1.9 -> destination=:1.97 serial=1710 reply_serial=2
uint32 3
I'm attaching two files:
In nm-dbus-devices.txt I've added all dbus properties of all the devices, just in case it helps to debug this. It can be seen that the wlp2s0 device (/org/freedesktop/NetworkManager/Devices/2) has Ip4Connectivity and Ip6Connectivity as 3 (that I guess later translates to the global Connectivity being 3) but that's strange since the interface doesn't have a route or even an ip address.
Note that NM_CONNECTIVITY_LIMITED is documented as "The host is connected to a network, does not appear to be able to reach the full Internet, but a captive portal has not been detected." . Also note that the State of the device is 20 (NM_STATE_DISCONNECTED) so it sure is not "connected to a network". Maybe the solution is as easy as setting all Connectivities to NM_CONNECTIVITY_NONE when the State is set to NM_STATE_DISCONNECTED (and maybe even ignore connectivity checks, since they don't make sense in a disconnected device, do they?).
In nm-service.log I've put the output of journalctl -b -u NetworkManager.service
after setting the logging domains to CONCHECK:TRACE,DEVICE:TRACE
, rebooting (with wireless disabled and no wired interface) and running the above dbus commands. It seems to me the important part here is:
mar 11 17:10:16 geeko2 NetworkManager[1576]: <debug> [1552320616.0223] connectivity: (wlp2s0,IPv4,1) can't resolve a name via systemd-resolved: GDBus.Error:org.freedesktop.resolve1.NoNameServers: No appropriate name servers or networks for name found
mar 11 17:10:16 geeko2 NetworkManager[1576]: <debug> [1552320616.0229] connectivity: (wlp2s0,IPv6,2) can't resolve a name via systemd-resolved: GDBus.Error:org.freedesktop.resolve1.NoNameServers: No appropriate name servers or networks for name found
mar 11 17:10:16 geeko2 NetworkManager[1576]: <debug> [1552320616.0230] connectivity: (wlp2s0,IPv4,1) check completed: LIMITED; check failed: (6) Couldn't resolve host name
mar 11 17:10:16 geeko2 NetworkManager[1576]: <trace> [1552320616.0231] device[0x55b044eab9a0] (wlp2s0): connectivity: [Ipv4] complete check (seq:1, state:LIMITED)
mar 11 17:10:16 geeko2 NetworkManager[1576]: <trace> [1552320616.0231] device[0x55b044eab9a0] (wlp2s0): connectivity: [IPv4] periodic-check: re-scheduled in 1893 milliseconds (2 seconds interval)
mar 11 17:10:16 geeko2 NetworkManager[1576]: <debug> [1552320616.0231] device[0x55b044eab9a0] (wlp2s0): connectivity state changed from UNKNOWN to LIMITED
mar 11 17:10:16 geeko2 NetworkManager[1576]: <debug> [1552320616.0238] connectivity: (wlp2s0,IPv6,2) check completed: LIMITED; check failed: (6) Couldn't resolve host name
mar 11 17:10:16 geeko2 NetworkManager[1576]: <trace> [1552320616.0238] device[0x55b044eab9a0] (wlp2s0): connectivity: [Ipv6] complete check (seq:2, state:LIMITED)
So it's setting the connectivity to LIMITED after it couldn't resolve the conncheck hostname. That would make sense if there was a resolver problem with an active network, but with the device being DISCONNECTED, I think it would make more sense to set connectivity to NONE.
As a last note, this is slightly related to #89 (closed) in essence, but even if I also have a virbr0 device (unconfigured and not even ip a
shows it), it's completely unrelated to the problem at hand.