Skip to contentSkip to conversation

netconfig: Enable DHCP info+ logging by default

PATCH New Michael Johnson 1 participant 1 message May 18, 2022

lore
Share & tools
lore

Michael Johnson

author
#0 lore raw

PATCH 1/1 netconfig: Enable DHCP info+ logging by default

The rest of iwd logs info, warn, and errors by default so this patch just copies that behavior for the DHCP client. Debug logging is enabled via the IWD_DHCP_DEBUG env as before.

---
 src/netconfig.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
src/netconfig.c +5 -2
index 6694a0e9..91f2b9ff 100644
@@ -1621,6 +1621,7 @@ struct netconfig *netconfig_new(uint32_t ifindex)
 	struct netdev *netdev = netdev_find(ifindex);
 	struct netconfig *netconfig;
 	struct l_icmp6_client *icmp6;
+	int dhcp_debug = L_LOG_INFO;
 
 	if (!netconfig_list)
 		return NULL;
@@ -1641,8 +1642,10 @@ struct netconfig *netconfig_new(uint32_t ifindex)
 					netconfig, NULL);
 
 	if (getenv("IWD_DHCP_DEBUG"))
-		l_dhcp_client_set_debug(netconfig->dhcp_client, do_debug,
-							"[DHCPv4] ", NULL);
+		dhcp_debug = L_LOG_DEBUG;
+
+	l_dhcp_client_set_debug(netconfig->dhcp_client, do_debug,
+						"[DHCPv4] ", NULL, dhcp_debug);
 
 	netconfig->dhcp6_client = l_dhcp6_client_new(ifindex);
 	l_dhcp6_client_set_event_handler(netconfig->dhcp6_client,
Signature · 1 line
2.25.1