]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
generator: Make debug log for payload substructure rules more clear
authorTobias Brunner <tobias@strongswan.org>
Wed, 2 Oct 2024 08:06:41 +0000 (10:06 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 2 Oct 2024 08:08:51 +0000 (10:08 +0200)
Similar to the previous commit.  Instead of

  generating rule 10 (1258)

followed by (or not if the list is empty)

  generating payload of type PROPOSAL_SUBSTRUCTURE

we now get

  generating rule 10 LIST of PROPOSAL_SUBSTRUCTURE

in the debug log.

src/libcharon/encoding/generator.c

index aaa7f723fcd00388ca0f38bfd24f8e6978d73cdc..3da5f7216495eed764fdd8c7c8a9ae37b596d7b5 100644 (file)
@@ -466,8 +466,16 @@ METHOD(generator_t, generate_payload, void,
        {
                if (this->debug)
                {
-                       DBG2(DBG_ENC, "  generating rule %d %N",
-                                i, encoding_type_names, rules[i].type);
+                       if (rules[i].type < PAYLOAD_LIST)
+                       {
+                               DBG2(DBG_ENC, "  generating rule %d %N",
+                                        i, encoding_type_names, rules[i].type);
+                       }
+                       else
+                       {
+                               DBG2(DBG_ENC, "  generating rule %d LIST of %N",
+                                        i, payload_type_names, rules[i].type - PAYLOAD_LIST);
+                       }
                }
                switch ((int)rules[i].type)
                {