From 35716df9bca8ff330155af1238a7c4a6233c48e0 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 1 May 2023 12:12:54 +0200 Subject: [PATCH] dhcp: Fix build with DEBUG_LEVEL < 1 --- src/libcharon/plugins/dhcp/dhcp_socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcharon/plugins/dhcp/dhcp_socket.c b/src/libcharon/plugins/dhcp/dhcp_socket.c index a3572766d..718936293 100644 --- a/src/libcharon/plugins/dhcp/dhcp_socket.c +++ b/src/libcharon/plugins/dhcp/dhcp_socket.c @@ -304,13 +304,14 @@ static bool discover(private_dhcp_socket_t *this, { dhcp_option_t *option; dhcp_t dhcp; - chunk_t mac; int optlen; optlen = prepare_dhcp(this, transaction, DHCP_DISCOVER, &dhcp); - mac = chunk_from_thing(dhcp.client_hw_addr); +#if DEBUG_LEVEL >= 1 + chunk_t mac = chunk_from_thing(dhcp.client_hw_addr); DBG1(DBG_CFG, "sending DHCP DISCOVER for %#B to %H", &mac, this->dst); +#endif option = (dhcp_option_t*)&dhcp.options[optlen]; option->type = DHCP_PARAM_REQ_LIST;