some imsg types are missing from the big switch in imsg_to_str(),
noticed after a report in m...@opensmtpd.org.  Tracing shows:

: imsg: lka <- dispatcher: IMSG_??? (139) (len=42)

(imsg #139 should be IMSG_REPORT_SMTP_FILTER_RESPONSE if I'm counting
right.)

Instead of checking one by one (they're a lot!) I just copied over the
list from smtpd.h and ran an emacs macro.  Some entries changed place,
but since the list is long I figured this was the best way to keep
everything in sync.

ok?

diff /usr/src
commit - af580bd60cce9d8599fddb1cffa69d16b70ae3a7
path + /usr/src
blob - 0bd24de8a65d0655a9866c5d3e66ad82a152959a
file + usr.sbin/smtpd/smtpd.c
--- usr.sbin/smtpd/smtpd.c
+++ usr.sbin/smtpd/smtpd.c
@@ -2081,19 +2081,22 @@ imsg_to_str(int type)
 
        CASE(IMSG_REPORT_SMTP_LINK_CONNECT);
        CASE(IMSG_REPORT_SMTP_LINK_DISCONNECT);
-       CASE(IMSG_REPORT_SMTP_LINK_TLS);
        CASE(IMSG_REPORT_SMTP_LINK_GREETING);
        CASE(IMSG_REPORT_SMTP_LINK_IDENTIFY);
+       CASE(IMSG_REPORT_SMTP_LINK_TLS);
        CASE(IMSG_REPORT_SMTP_LINK_AUTH);
-
        CASE(IMSG_REPORT_SMTP_TX_RESET);
        CASE(IMSG_REPORT_SMTP_TX_BEGIN);
+       CASE(IMSG_REPORT_SMTP_TX_MAIL);
+       CASE(IMSG_REPORT_SMTP_TX_RCPT);
        CASE(IMSG_REPORT_SMTP_TX_ENVELOPE);
+       CASE(IMSG_REPORT_SMTP_TX_DATA);
        CASE(IMSG_REPORT_SMTP_TX_COMMIT);
        CASE(IMSG_REPORT_SMTP_TX_ROLLBACK);
-
        CASE(IMSG_REPORT_SMTP_PROTOCOL_CLIENT);
        CASE(IMSG_REPORT_SMTP_PROTOCOL_SERVER);
+       CASE(IMSG_REPORT_SMTP_FILTER_RESPONSE);
+       CASE(IMSG_REPORT_SMTP_TIMEOUT);
 
        CASE(IMSG_FILTER_SMTP_BEGIN);
        CASE(IMSG_FILTER_SMTP_END);
@@ -2104,6 +2107,7 @@ imsg_to_str(int type)
        CASE(IMSG_CA_RSA_PRIVENC);
        CASE(IMSG_CA_RSA_PRIVDEC);
        CASE(IMSG_CA_ECDSA_SIGN);
+
        default:
                (void)snprintf(buf, sizeof(buf), "IMSG_??? (%d)", type);
 

Reply via email to