[Swan-dev] calling loglog(RC_LOG_SERIOUS, ...) when processing a message

Andrew Cagney andrew.cagney at gmail.com
Fri Dec 13 17:52:53 UTC 2019


First a fun fact:

    whack_log_fd is valid IFF pluto is executing the whack event handler.

Consequently any code logging to whack outside of the whack event
handler needs to use a reference saved in either state or pending.

When processing a raw message, whack_log_fd is never valid and a
matching state has yet to be found, so trying to log to whack using:

               loglog(RC_LOG_SERIOUS,
                        "message %s contained an unknown critical
payload type (%s)",
                        role, enum_show(&ikev2_payload_names, np));

is pointless.  This means, as best I can tell, I can reduce calls like this to:

               plog_md(md,
                        "message %s contained an unknown critical
payload type (%s)",
                        role, enum_show(&ikev2_payload_names, np));

Andrew


More information about the Swan-dev mailing list