After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776848 - nmcli API and implementation uses inconsistent connectivity enum
nmcli API and implementation uses inconsistent connectivity enum
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: API
unspecified
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-01-04 04:46 UTC by yossi
Modified: 2017-01-04 09:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description yossi 2017-01-04 04:46:06 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