RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1454883 - [RFE] extend D-Bus API to better export active connection state
Summary: [RFE] extend D-Bus API to better export active connection state
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager
Version: 7.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Thomas Haller
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks: 1470965
TreeView+ depends on / blocked
 
Reported: 2017-05-23 16:54 UTC by Thomas Haller
Modified: 2018-04-10 13:26 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 13:24:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0778 0 None None None 2018-04-10 13:26:21 UTC

Description Thomas Haller 2017-05-23 16:54:34 UTC
When a connection in NM activates, this is tracked via the active-connection [1]

[1] https://developer.gnome.org/NetworkManager/unstable/gdbus-org.freedesktop.NetworkManager.Connection.Active.html


`nmcli connection up "$CONN"` has a --wait option (that defaults to 90 seconds). That means, nmcli will wait until the connection is fully activated.


The concept of what it means to be fully activated has many aspects. E.g. is IPv4 ready? IPv6? Is the layer2 up? Is the master activated but waiting for slaves?


For that reason, nmcli not only monitors the active-connection state, but also considers the device-state [2]

[2] https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/clients/cli/connections.c?id=9c3df9caa3296a55fe54e6aa02fe8a11b27deaba#n2199



For a client, it should be sufficient to monitor only the active-connection option to decide whether a device is activted. For that, we should add a "StateFlags" argument, with flags like:

   NM_ACTIVATION_STATE_FLAG_LAYER2_READY,
   NM_ACTIVATION_STATE_FLAG_IP4_READY,
   NM_ACTIVATION_STATE_FLAG_DHCP4_READY,
   NM_ACTIVATION_STATE_FLAG_IP6_READY,
   NM_ACTIVATION_STATE_FLAG_DHCP6_READY,
   NM_ACTIVATION_STATE_FLAG_AUTO6_READY,
   NM_ACTIVATION_STATE_FLAG_MASTER_READY,
   NM_ACTIVATION_STATE_FLAG_MASTER_HAS_SLAVES,



with these flags, nmcli would wait until
  - state reaches NM_ACTIVE_CONNECTION_STATE_ACTIVATED
  - or, state-flags have NM_ACTIVATION_STATE_FLAG_MASTER_READY
    -- but possibly: if NM_ACTIVATION_STATE_FLAG_MASTER_HAS_SLAVES is set too, 
       we would wait for the device to reach     
       state=NM_ACTIVE_CONNECTION_STATE_ACTIVATED.

Comment 2 Thomas Haller 2017-10-02 12:27:38 UTC
pleas review th/activation-state-flags-rh1454883

Comment 3 Beniamino Galvani 2017-10-03 12:27:44 UTC
(In reply to Thomas Haller from comment #2)
> pleas review th/activation-state-flags-rh1454883

Looks good to me.

Comment 4 Francesco Giudici 2017-10-04 17:04:10 UTC
@@ -1219,17 +1241,25 @@ constructed (GObject *object)

        G_OBJECT_CLASS (nm_active_connection_parent_class)->constructed (object);

-       if (!priv->applied_connection && priv->settings_connection)
+       if (   !priv->applied_connection
+           && priv->settings_connection)
                priv->applied_connection = nm_simple_connection_new_clone (NM_CONNECTION (priv->settings_connection));

-       if (priv->applied_connection)
-               nm_connection_clear_secrets (priv->applied_connection);
-
        _LOGD ("constructed (%s, version-id %llu, type %s)",
               G_OBJECT_TYPE_NAME (self),
               (unsigned long long) priv->version_id,
               nm_activation_type_to_string (priv->activation_type));

+       if (priv->applied_connection) {
+               /* priv->applied_connection was set during the construction of the object.
+                * It's not yet fully initialized, so do that now.
+                *
+                * We delayed that, because we may log in _set_applied_connection_take(), and the
+                * first logging line should be "constructed" above). */
+               _set_applied_connection_take (self,
+                                             g_steal_pointer (&priv->applied_connection));

If we call the constructed method and priv->applied_connection is already set, we will end failing _set_applied_connection_take as it does:
nm_assert (!priv->applied_connection);

rest looks good

Comment 5 Francesco Giudici 2017-10-05 09:49:01 UTC
(In reply to Francesco Giudici from comment #4)
> @@ -1219,17 +1241,25 @@ constructed (GObject *object)
> 
> [...]
> +                                    g_steal_pointer (&priv->applied_connection));

I was wrong: there is a g_steal_pointer there, so the assert in _set_applied_connection_take will be true.
Sorry.

Branch lgtm

Comment 8 Vladimir Benes 2018-01-22 15:46:44 UTC
Automated checks added for bond master/slave and ethernet devices. Will be executed on a daily bases.

Comment 9 Vladimir Benes 2018-01-25 09:15:56 UTC
Automated for CI, working well in 7.5 for both bond master/slave and ethernet devices.

Comment 12 errata-xmlrpc 2018-04-10 13:24:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0778


Note You need to log in before you can comment on or make changes to this bug.