]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
dhcp: Fix build with DEBUG_LEVEL < 1
authorTobias Brunner <tobias@strongswan.org>
Mon, 1 May 2023 10:12:54 +0000 (12:12 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 8 May 2023 15:32:18 +0000 (17:32 +0200)
src/libcharon/plugins/dhcp/dhcp_socket.c

index a3572766da09f8f3fe51c7d51b7a5d0a8fce0ab4..71893629394ec989b60d30ef2a42916cb43c830d 100644 (file)
@@ -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;