chiark / gitweb /
site: Record whynot in default (end of comm_notify) case
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 21 Sep 2019 15:13:29 +0000 (16:13 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 24 Oct 2019 18:16:17 +0000 (19:16 +0100)
send_nak will print the type and the two indices, so we don't.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
secnet.h
site.c

index 95f3413325a8ef3319b3b2402698d583ec0242b5..95bda9940ebec6b8981b74382f3dc9dca994d2c3 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -465,6 +465,10 @@ typedef struct comm_clientinfo *comm_clientinfo_fn(void *state, dict_t*,
  * The semantics depend on the dict and defined by the comm, and
  * should be documented in README. */
 
+enum {
+    comm_notify_whynot_general,
+};
+
 /* Return True if the packet was processed, and shouldn't be passed to
    any other potential receivers. (buf is freed iff True returned.) */
 typedef bool_t comm_notify_fn(void *state, struct buffer_if *buf,
diff --git a/site.c b/site.c
index add60398aa2195bdf7b27eee1d9e84d2e75a8db3..8ca87690baf350f7c3fee99ddd595db34bb4ade8 100644 (file)
--- a/site.c
+++ b/site.c
@@ -2084,6 +2084,9 @@ static bool_t site_incoming(void *sst, struct buffer_if *buf,
        return True;
     }
 
+    if (priomsg_update_p(whynot, comm_notify_whynot_general))
+       truncmsg_add_string(&whynot->m,
+                           "not MSG1 or PROD; unknown dest index");
     return False;
 }