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:
97ce488f5f ('dhcp/internal: decrease logging level when
retrieving dhcp options')
This commit is contained in:
Francesco Giudici 2019-07-29 17:43:18 +02:00
parent dbd9ed1c62
commit 862177f6b6

View file

@ -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) {