From: Tobias Brunner Date: Wed, 2 Oct 2024 08:06:41 +0000 (+0200) Subject: generator: Make debug log for payload substructure rules more clear X-Git-Tag: 6.0.0rc1~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=089977b69d6deef3a4823c7b44ecc1707f6fd632;p=thirdparty%2Fstrongswan.git generator: Make debug log for payload substructure rules more clear 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. --- diff --git a/src/libcharon/encoding/generator.c b/src/libcharon/encoding/generator.c index aaa7f723fc..3da5f72164 100644 --- a/src/libcharon/encoding/generator.c +++ b/src/libcharon/encoding/generator.c @@ -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) {