[SECNET PATCH 12/14] site: Record whynot in default (end of comm_notify) case

Ian Jackson ijackson at chiark.greenend.org.uk
Sat Sep 21 17:07:57 BST 2019


send_nak will print the type and the two indices, so we don't.

Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
---
 secnet.h | 4 ++++
 site.c   | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/secnet.h b/secnet.h
index 81c1ce4..6cd277e 100644
--- a/secnet.h
+++ b/secnet.h
@@ -450,6 +450,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 4df131f..b210e8b 100644
--- a/site.c
+++ b/site.c
@@ -2032,6 +2032,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;
 }
 
-- 
2.11.0




More information about the sgo-software-discuss mailing list