From: Tobias Brunner Date: Mon, 1 May 2023 14:30:06 +0000 (+0200) Subject: tnccs-11: Fix build with DEBUG_LEVEL < 2 X-Git-Tag: 5.9.11rc1~12^2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a0ee0cbf90109b3701ec2d17033636d3520ae982;p=thirdparty%2Fstrongswan.git tnccs-11: Fix build with DEBUG_LEVEL < 2 --- diff --git a/src/libtnccs/plugins/tnccs_11/tnccs_11.c b/src/libtnccs/plugins/tnccs_11/tnccs_11.c index 4ded303bd2..93c43b38a8 100644 --- a/src/libtnccs/plugins/tnccs_11/tnccs_11.c +++ b/src/libtnccs/plugins/tnccs_11/tnccs_11.c @@ -277,15 +277,15 @@ static void handle_message(private_tnccs_11_t *this, tnccs_msg_t *msg) } case TNCCS_MSG_ERROR: { - tnccs_error_msg_t *err_msg; +#if DEBUG_LEVEL >= 1 + tnccs_error_msg_t *err_msg = (tnccs_error_msg_t*)msg; tnccs_error_type_t error_type; char *error_msg; - err_msg = (tnccs_error_msg_t*)msg; error_msg = err_msg->get_message(err_msg, &error_type); DBG1(DBG_TNC, "received '%N' TNCCS-Error: %s", tnccs_error_type_names, error_type, error_msg); - +#endif /* we assume that all errors are fatal */ this->fatal_error = TRUE; break; @@ -305,6 +305,7 @@ static void handle_message(private_tnccs_11_t *this, tnccs_msg_t *msg) } case TNCCS_MSG_REASON_STRINGS: { +#if DEBUG_LEVEL >= 2 tnccs_reason_strings_msg_t *reason_msg; chunk_t reason_string, reason_lang; @@ -314,6 +315,7 @@ static void handle_message(private_tnccs_11_t *this, tnccs_msg_t *msg) reason_string.ptr); DBG2(DBG_TNC, "language code is '%.*s'", (int)reason_lang.len, reason_lang.ptr); +#endif break; } default: