summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/dhcp/nm-dhcp-client.c19
-rw-r--r--src/core/dhcp/nm-dhcp-nettools.c6
2 files changed, 15 insertions, 10 deletions
diff --git a/src/core/dhcp/nm-dhcp-client.c b/src/core/dhcp/nm-dhcp-client.c
index d885d07454..81bef8dfda 100644
--- a/src/core/dhcp/nm-dhcp-client.c
+++ b/src/core/dhcp/nm-dhcp-client.c
@@ -436,6 +436,17 @@ _nm_dhcp_client_notify(NMDhcpClient *self,
} else {
priv->l3cfg_notify.wait_dhcp_commit = FALSE;
}
+
+ if (!priv->l3cfg_notify.wait_dhcp_commit && priv->l3cd) {
+ gs_free_error GError *error = NULL;
+
+ _LOGD("accept lease right away");
+ if (!_dhcp_client_accept(self, priv->l3cd, &error)) {
+ _LOGD("accept failed: %s", error->message);
+ /* Unclear why this happened, or what to do about it. Just proceed. */
+ }
+ }
+
l3_cfg_notify_check_connected(self);
{
@@ -501,12 +512,8 @@ _accept(NMDhcpClient *self, const NML3ConfigData *l3cd, GError **error)
if (!NM_IS_IPv4(priv->config.addr_family))
return TRUE;
- if (!priv->v4.bound.invocation) {
- nm_utils_error_set(error,
- NM_UTILS_ERROR_UNKNOWN,
- "calling accept in unexpected script state");
- return FALSE;
- }
+ if (!priv->v4.bound.invocation)
+ return TRUE;
g_dbus_method_invocation_return_value(g_steal_pointer(&priv->v4.bound.invocation), NULL);
return TRUE;
diff --git a/src/core/dhcp/nm-dhcp-nettools.c b/src/core/dhcp/nm-dhcp-nettools.c
index 3f6e3ac8d4..494745bbef 100644
--- a/src/core/dhcp/nm-dhcp-nettools.c
+++ b/src/core/dhcp/nm-dhcp-nettools.c
@@ -1036,10 +1036,8 @@ _accept(NMDhcpClient *client, const NML3ConfigData *l3cd, GError **error)
g_return_val_if_fail(l3cd, FALSE);
- if (priv->granted.lease_l3cd != l3cd) {
- nm_utils_error_set(error, NM_UTILS_ERROR_UNKNOWN, "calling accept in unexpected state");
- return FALSE;
- }
+ if (priv->granted.lease_l3cd != l3cd)
+ return TRUE;
nm_assert(priv->granted.lease);