summaryrefslogtreecommitdiff
path: root/src/starter/starterwhack.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/starter/starterwhack.c')
-rw-r--r--src/starter/starterwhack.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/starter/starterwhack.c b/src/starter/starterwhack.c
index 19fa9558f..d29b87873 100644
--- a/src/starter/starterwhack.c
+++ b/src/starter/starterwhack.c
@@ -11,7 +11,7 @@
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
- * RCSID $Id: starterwhack.c 3267 2007-10-08 19:57:54Z andreas $
+ * RCSID $Id: starterwhack.c 3405 2007-12-19 00:49:32Z andreas $
*/
#include <sys/types.h>
@@ -148,17 +148,22 @@ connection_name(starter_conn_t *conn)
}
static void
-set_whack_end(whack_end_t *w, starter_end_t *end)
+set_whack_end(whack_end_t *w, starter_end_t *end, sa_family_t family)
{
w->id = end->id;
w->cert = end->cert;
w->ca = end->ca;
w->groups = end->groups;
w->host_addr = end->addr;
- w->host_nexthop = end->nexthop;
w->host_srcip = end->srcip;
w->has_client = end->has_client;
+ if (family == AF_INET6 && isanyaddr(&end->nexthop))
+ {
+ anyaddr(AF_INET6, &end->nexthop);
+ }
+ w->host_nexthop = end->nexthop;
+
if (w->has_client)
w->client = end->subnet;
else
@@ -246,8 +251,8 @@ starter_whack_add_conn(starter_conn_t *conn)
msg.sa_keying_tries = conn->sa_keying_tries;
msg.policy = conn->policy;
- set_whack_end(&msg.left, &conn->left);
- set_whack_end(&msg.right, &conn->right);
+ set_whack_end(&msg.left, &conn->left, conn->addr_family);
+ set_whack_end(&msg.right, &conn->right, conn->addr_family);
msg.esp = conn->esp;
msg.ike = conn->ike;