NetworkManager/warn-no-DHCP-client.patch
Jiří Klimeš c81d7a693f several fixes on top of 0.9.8.8
- dispatcher: fix crash while logging from signal handler (rh #1017884)
- core: fix segfault in NMAgentManager (rh #1031196)
- dhcp: print a warning when we can't get DHCP lease (no DHCP client s available)
2013-11-20 15:17:38 +01:00

43 lines
1.4 KiB
Diff

From c72f5ac130d58695acdc9c9664cd96d07183e339 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Thu, 17 Oct 2013 14:39:57 +0200
Subject: [PATCH] dhcp: print a warning when we can't get DHCP lease (no DHCP
client s available)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
src/dhcp-manager/nm-dhcp-manager.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c
index 7088839..d40eb48 100644
--- a/src/dhcp-manager/nm-dhcp-manager.c
+++ b/src/dhcp-manager/nm-dhcp-manager.c
@@ -554,13 +554,18 @@ nm_dhcp_manager_get_lease_config (NMDHCPManager *self,
const char *uuid,
gboolean ipv6)
{
- NMDHCPManagerPrivate *priv = NM_DHCP_MANAGER_GET_PRIVATE (self);
+ NMDHCPManagerPrivate *priv;
+ g_return_val_if_fail (NM_IS_DHCP_MANAGER (self), NULL);
g_return_val_if_fail (iface != NULL, NULL);
g_return_val_if_fail (uuid != NULL, NULL);
+ priv = NM_DHCP_MANAGER_GET_PRIVATE (self);
+
if (priv->get_lease_config_func)
return priv->get_lease_config_func (iface, uuid, ipv6);
+
+ nm_log_warn (LOGD_DHCP, "Cannot get a DHCP lease config (no usable DHCP client was found!)");
return NULL;
}
--
1.7.11.7