]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
tnccs-11: Fix build with DEBUG_LEVEL < 2
authorTobias Brunner <tobias@strongswan.org>
Mon, 1 May 2023 14:30:06 +0000 (16:30 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 8 May 2023 15:32:17 +0000 (17:32 +0200)
src/libtnccs/plugins/tnccs_11/tnccs_11.c

index 4ded303bd230d956605f5d958ec07385a67c5741..93c43b38a854fc2704b08967b3c91ac484b7f9a1 100644 (file)
@@ -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: