From: Tobias Brunner Date: Mon, 1 May 2023 10:12:54 +0000 (+0200) Subject: dhcp: Fix build with DEBUG_LEVEL < 1 X-Git-Tag: 5.9.11rc1~12^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35716df9bca8ff330155af1238a7c4a6233c48e0;p=thirdparty%2Fstrongswan.git dhcp: Fix build with DEBUG_LEVEL < 1 --- diff --git a/src/libcharon/plugins/dhcp/dhcp_socket.c b/src/libcharon/plugins/dhcp/dhcp_socket.c index a3572766da..7189362939 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;