chiark / gitweb /
site: Force use of configured name only if we are mobile
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Jun 2014 16:45:52 +0000 (17:45 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Jun 2014 16:51:06 +0000 (17:51 +0100)
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@chiark.greenend.org.uk>
debian/changelog
site.c

index 7fac0e8a807ce680aa8e7c94bb0fa21583c39570..392c5f7ee7a15e09a9d77693c9fbf87ac25822ff 100644 (file)
@@ -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 379ab0d96976aefc90f5928c60a6e5b492165144..c452011e5538a6c7458928d9a0e3853ade0be1f5 100644 (file)
--- 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);