diff options
| author | Michael Biebl <biebl@debian.org> | 2025-01-20 19:08:06 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2025-01-20 19:08:06 +0100 |
| commit | 818258cf34b83fbc754633295e1052d4752d7b15 (patch) | |
| tree | aa45b6a831d6c0ee954b1a03891ad3da09349528 /src/core/dhcp/nm-dhcp-client.c | |
| parent | e465722b908aa870bdc293b9a417d3c15294aa6d (diff) | |
New upstream version 1.50.2 upstream/1.50.2
Diffstat (limited to 'src/core/dhcp/nm-dhcp-client.c')
| -rw-r--r-- | src/core/dhcp/nm-dhcp-client.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/core/dhcp/nm-dhcp-client.c b/src/core/dhcp/nm-dhcp-client.c index 4ebc1754..cd6e67e2 100644 --- a/src/core/dhcp/nm-dhcp-client.c +++ b/src/core/dhcp/nm-dhcp-client.c @@ -275,10 +275,25 @@ nm_dhcp_client_create_options_dict(NMDhcpClient *self, gboolean static_keys) return options; } +/** + * nm_dhcp_client_get_lease(): + * @self: the client + * @ignore_acd_pending: FALSE means to only return the lease that already + * passed ACD, thus it is in use by us. TRUE means to return a new lease + * that might still be pending of Address Collision Detection (ACD) check, + * if there is one, or return the current lease that passed ACD if not. + * + * Returns the current lease that passed ACD or a pending lease still under + * ACD check. + * + */ const NML3ConfigData * -nm_dhcp_client_get_lease(NMDhcpClient *self) +nm_dhcp_client_get_lease(NMDhcpClient *self, gboolean ignore_acd_pending) { - return NM_DHCP_CLIENT_GET_PRIVATE(self)->l3cd_curr; + if (ignore_acd_pending) + return NM_DHCP_CLIENT_GET_PRIVATE(self)->l3cd_curr; + else + return NM_DHCP_CLIENT_GET_PRIVATE(self)->l3cd_next; } /*****************************************************************************/ |