trap-manager: Allow local address to be unspecified
authorTobias Brunner <tobias@strongswan.org>
Wed, 27 Apr 2016 08:56:54 +0000 (10:56 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 6 May 2016 13:56:19 +0000 (15:56 +0200)
If there is currently no route to reach the other peer we just default
to left=%any.  The local address is only really used to resolve
leftsubnet=%dynamic anyway (and perhaps for MIPv6 proxy transport mode).

Fixes #1375.

src/libcharon/sa/trap_manager.c

index 7eb99ca..40a0682 100644 (file)
@@ -197,9 +197,7 @@ METHOD(trap_manager_t, install, uint32_t,
                        me = charon->kernel->get_source_addr(charon->kernel, other, NULL);
                        if (!me)
                        {
-                               DBG1(DBG_CFG, "installing trap failed, local address unknown");
-                               other->destroy(other);
-                               return 0;
+                               me = host_create_any(other->get_family(other));
                        }
                        me->set_port(me, ike_cfg->get_my_port(ike_cfg));
                }