[PATCH] site: Force use of configured name only if we are mobile

Ian Jackson ijackson at chiark.greenend.org.uk
Mon Jun 2 17:49:59 BST 2014


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 <ijackson at chiark.greenend.org.uk>
---
 site.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
1.7.10.4




More information about the sgo-software-discuss mailing list