[SECNET PATCH 10/14] site: named_for_us: Introduce NAME_MATCHES

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


This will make the next changes much smaller.

No functional change.

Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
---
 site.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/site.c b/site.c
index c1571c3..16bceaf 100644
--- a/site.c
+++ b/site.c
@@ -1776,9 +1776,15 @@ 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(&m->remote,st->remotename)
-	&& name_matches(&m->local,st->localname);
+	&& NAME_MATCHES(remote)
+	&& NAME_MATCHES(local );
+
+#undef NAME_MATCHES
 }
 
 static bool_t we_have_priority(struct site *st, const struct msg *m) {
-- 
2.11.0




More information about the sgo-software-discuss mailing list