GNOME Bugzilla – Bug 776848
nmcli API and implementation uses inconsistent connectivity enum
Last modified: 2017-01-04 09:14:10 UTC
The dbus value is limited for connectivity (4), but it's actually in full connectivity, there is a bug in the documentation I believe. Please confirm and advise. The dbus value[3] is 4. The nmcli reads the value 4 (limited by the API[1]) for the connectivity and consider the connectivity to be FULL. $ nmcli general status STATE CONNECTIVITY WIFI-HW WIFI WWAN-HW WWAN connected full enabled enabled enabled enabled The API[1] defines: enum NMConnectivityState: NM_CONNECTIVITY_UNKNOWN = 1 NM_CONNECTIVITY_NONE = 2 NM_CONNECTIVITY_PORTAL = 3 NM_CONNECTIVITY_LIMITED = 4 NM_CONNECTIVITY_FULL = 5 But the source code[2] uses an enum that starts from 0: 124typedef enum { 125 NM_CONNECTIVITY_UNKNOWN, 126 NM_CONNECTIVITY_NONE, 127 NM_CONNECTIVITY_PORTAL, 128 NM_CONNECTIVITY_LIMITED, 129 NM_CONNECTIVITY_FULL 130} NMConnectivityState; 131 [1]https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html [2]http://code.metager.de/source/xref/freedesktop/NetworkManager/NetworkManager/libnm-core/nm-dbus-interface.h#124 [3] https://i.stack.imgur.com/Jfpgm.png
yes, it's a bug in the documentation. master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=44ab504cf77963f0d246bdf695b9a2d5ec0b1603 nm-1-4: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=c5650d35000f12d3aa9305b2728ce7c3f8444ff5 nm-1-2: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=0961c4b969dfc5aa84c2d608f4eb0b989bcb516e Thanks for reporting!