chiark / gitweb /
site: Record whynot in default (end of comm_notify) case
[secnet.git] / site.c
diff --git a/site.c b/site.c
index b9ebc4bab77eebfe8a4fb56b2b6fc0f775995f43..8ca87690baf350f7c3fee99ddd595db34bb4ade8 100644 (file)
--- a/site.c
+++ b/site.c
@@ -1829,14 +1829,18 @@ static bool_t named_for_us(struct site *st, const struct buffer_if *buf_in,
     struct buffer_if buf[1];
     buffer_readonly_clone(buf,buf_in);
 
-#define NAME_MATCHES(lr) \
-    name_matches(&m->lr, st->lr##name)
-
-    return unpick_msg(st,type,buf,m)
-       && NAME_MATCHES(remote)
-       && NAME_MATCHES(local );
-
+    if (!unpick_msg(st,type,buf,m)) {
+       return False;
+    }
+#define NAME_MATCHES(lr)                       \
+    if (!name_matches(&m->lr, st->lr##name)) { \
+        return False;                          \
+    }
+    NAME_MATCHES(remote);
+    NAME_MATCHES(local );
 #undef NAME_MATCHES
+
+    return True;
 }
 
 static bool_t we_have_priority(struct site *st, const struct msg *m) {
@@ -2080,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;
 }