summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Giudici <fgiudici@redhat.com>2019-07-29 17:43:18 +0200
committerFrancesco Giudici <fgiudici@redhat.com>2019-09-13 18:44:32 +0200
commit862177f6b655ec027c4bdb0826040de1bb5d86d6 (patch)
treeff3d2be96221e84d7c5802488ebb52ba8d951c36
parentdbd9ed1c627018a5f91fef25ee81817be19d2606 (diff)
downloadNetworkManager-862177f6b655ec027c4bdb0826040de1bb5d86d6.tar.gz
dhcp: log the dhcp options got in the lease once for all plugin
Each plugin logged the options: just do that on dhcp state change and do in common code. Log the options at INFO level for all the plugins. This partially reverts the effects on the internal plugin of the commit: 97ce488f5f50 ('dhcp/internal: decrease logging level when retrieving dhcp options')
-rw-r--r--src/dhcp/nm-dhcp-client.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/dhcp/nm-dhcp-client.c b/src/dhcp/nm-dhcp-client.c
index 56660ff796..b9c673ddad 100644
--- a/src/dhcp/nm-dhcp-client.c
+++ b/src/dhcp/nm-dhcp-client.c
@@ -406,6 +406,17 @@ nm_dhcp_client_set_state (NMDhcpClient *self,
if ((priv->state == new_state) && (new_state != NM_DHCP_STATE_BOUND))
return;
+ if (_LOGI_ENABLED ()) {
+ gs_free const char **keys = NULL;
+ guint i, nkeys;
+
+ keys = nm_utils_strdict_get_keys (options, TRUE, &nkeys);
+ for (i = 0; i < nkeys; i++) {
+ _LOGI ("option %-20s => '%s'", keys[i],
+ (char *) g_hash_table_lookup (options, keys[i]));
+ }
+ }
+
if ( priv->addr_family == AF_INET6
&& new_state == NM_DHCP_STATE_BOUND) {
char *start, *iaid;
@@ -840,15 +851,6 @@ nm_dhcp_client_handle_event (gpointer unused,
g_variant_unref (value);
}
- if (nm_logging_enabled (LOGL_DEBUG, LOGD_DHCP6)) {
- GHashTableIter hash_iter;
- gpointer key, val;
-
- g_hash_table_iter_init (&hash_iter, str_options);
- while (g_hash_table_iter_next (&hash_iter, &key, &val))
- _LOGD ("option '%s'=>'%s'", (const char *) key, (const char *) val);
- }
-
/* Create the IP config */
if (g_hash_table_size (str_options) > 0) {
if (priv->addr_family == AF_INET) {