summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-05-19 09:08:54 +0200
committerThomas Haller <thaller@redhat.com>2021-05-19 09:21:48 +0200
commitaef9b95aaaec92937bae38b819d416c7042940d2 (patch)
tree076d1001401429e84ecf97fb04c723d716baf840
parentc34e36bb8d285123f8a18219f707cef0d90d5c53 (diff)
downloadNetworkManager-aef9b95aaaec92937bae38b819d416c7042940d2.tar.gz
dhcp: map "static" DHCP state for dhcpcd to bound
A user might configure /etc/dhcpcd.conf to contain static fallback addresses. In that case, the dhcpcd plugin reports the state as "static". Let's treat that the same way as bound. Note that this is not an officially supported or endorsed way of configuring fallback addresses in NetworkManager. Rather, when using DHCP plugins, the user can hack the system and make unsupported modifications in /etc/dhcpcd.conf or /etc/dhcp. This change only makes it a bit easier to do it. See-also: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/579#note_922758 https://bugzilla.gnome.org/show_bug.cgi?id=768362 Based-on-patch-by: gordonb3 <gordon@bosvangennip.nl>
-rw-r--r--src/core/dhcp/nm-dhcp-client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/dhcp/nm-dhcp-client.c b/src/core/dhcp/nm-dhcp-client.c
index 5d85500d8d..33a8173c45 100644
--- a/src/core/dhcp/nm-dhcp-client.c
+++ b/src/core/dhcp/nm-dhcp-client.c
@@ -363,7 +363,8 @@ state_to_string(NMDhcpState state)
static NMDhcpState
reason_to_state(NMDhcpClient *self, const char *iface, const char *reason)
{
- if (g_ascii_strcasecmp(reason, "bound") == 0 || g_ascii_strcasecmp(reason, "bound6") == 0)
+ if (g_ascii_strcasecmp(reason, "bound") == 0 || g_ascii_strcasecmp(reason, "bound6") == 0
+ || g_ascii_strcasecmp(reason, "static") == 0)
return NM_DHCP_STATE_BOUND;
else if (g_ascii_strcasecmp(reason, "renew") == 0 || g_ascii_strcasecmp(reason, "renew6") == 0
|| g_ascii_strcasecmp(reason, "reboot") == 0