From 4b5e68bee879ba7436de397eee4923da8bac6361 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 21 Sep 2019 16:17:56 +0100 Subject: [PATCH] site: named_for_us: Introduce NAME_MATCHES This will make the next changes much smaller. No functional change. Signed-off-by: Ian Jackson --- site.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/site.c b/site.c index a91d6c9..b9ebc4b 100644 --- a/site.c +++ b/site.c @@ -1828,9 +1828,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.30.2