diff options
author | Martin Willi <martin@revosec.ch> | 2012-06-20 10:01:05 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-06-20 10:02:01 +0200 |
commit | e2dd114f37c1ebd8f88f45d17edb41649fafce4e (patch) | |
tree | b2dcc07286afc28b17c0f256acb0d0efa71cae7f /src/libcharon/plugins/stroke/stroke_config.c | |
parent | f2fc138e8edb3967afe285b51aefbe4ab5395478 (diff) | |
download | strongswan-e2dd114f37c1ebd8f88f45d17edb41649fafce4e.tar.bz2 strongswan-e2dd114f37c1ebd8f88f45d17edb41649fafce4e.tar.xz |
Select requested virtual IP family based on remote TS, if no local TS available
Diffstat (limited to 'src/libcharon/plugins/stroke/stroke_config.c')
-rw-r--r-- | src/libcharon/plugins/stroke/stroke_config.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libcharon/plugins/stroke/stroke_config.c b/src/libcharon/plugins/stroke/stroke_config.c index 086a42baa..da0d2a74d 100644 --- a/src/libcharon/plugins/stroke/stroke_config.c +++ b/src/libcharon/plugins/stroke/stroke_config.c @@ -705,7 +705,7 @@ static peer_cfg_t *build_peer_cfg(private_stroke_config_t *this, if (!vip) { /* if it is set to something like %poolname, request an address */ if (msg->add_conn.me.subnets) - { /* use the same address as in subnet, if any */ + { /* use the same family as in local subnet, if any */ if (strchr(msg->add_conn.me.subnets, '.')) { vip = host_create_any(AF_INET); @@ -715,6 +715,17 @@ static peer_cfg_t *build_peer_cfg(private_stroke_config_t *this, vip = host_create_any(AF_INET6); } } + else if (msg->add_conn.other.subnets) + { /* use the same family as in remote subnet, if any */ + if (strchr(msg->add_conn.other.subnets, '.')) + { + vip = host_create_any(AF_INET); + } + else + { + vip = host_create_any(AF_INET6); + } + } else { if (strchr(ike_cfg->get_my_addr(ike_cfg, NULL), ':')) |