From: Ian Jackson Date: Mon, 2 Jun 2014 16:45:52 +0000 (+0100) Subject: site: Force use of configured name only if we are mobile X-Git-Tag: debian/0.3.2_beta1~1 X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/commitdiff_plain/7d8d39dc3418b0e709b76f08eb08ab7668239207?ds=sidebyside site: Force use of configured name only if we are mobile In c22c3541 we arranged to honour our local configured name for the peer even if the peer initiated the key setup. Previously we used the address on the incoming packets. However, this change can break some half-broken configurations, which would otherwise mostly work. Some of these configurations may even be deliberate, as a kind of poor version of the mobile site feature. But, if we are a mobile site it is very unlikely that we have a broken name or address (or at least, if we do, that things would work well). So, for now, restrict this new behaviour to the situation where we are mobile. Signed-off-by: Ian Jackson --- diff --git a/debian/changelog b/debian/changelog index 7fac0e8..392c5f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,8 @@ secnet (0.3.2~~) unstable; urgency=low and thus include git commit id where applicable. * Updates to release checklist in Makefile.in. * Use C99 _Bool for bool_t. - * Do name-resolution on peer-initiated key setup too (and - other name-resolution improvements). + * Do name-resolution on peer-initiated key setup too, when we are mobile + (and other name-resolution improvements). -- diff --git a/site.c b/site.c index 379ab0d..c452011 100644 --- a/site.c +++ b/site.c @@ -1631,7 +1631,7 @@ static bool_t site_incoming(void *sst, struct buffer_if *buf, if (process_msg1(st,buf,source,&named_msg)) { slog(st,LOG_SETUP_INIT,"key setup initiated by peer"); bool_t entered=enter_new_state(st,SITE_SENTMSG2); - if (entered && st->address) + if (entered && st->address && st->local_mobile) /* We must do this as the very last thing, because the resolver callback might reenter us. */ ensure_resolving(st);