diff options
author | Martin Willi <martin@strongswan.org> | 2006-09-05 14:07:25 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-09-05 14:07:25 +0000 |
commit | a655f5c09c2ba180b7d393dbdfc8b8057293d9ab (patch) | |
tree | e645a61c178ebcb932a56f09e4bdcca80b230431 /src/charon/config/traffic_selector.c | |
parent | da8ab11e918353293953636abea73f12bf8f956e (diff) | |
download | strongswan-a655f5c09c2ba180b7d393dbdfc8b8057293d9ab.tar.bz2 strongswan-a655f5c09c2ba180b7d393dbdfc8b8057293d9ab.tar.xz |
reuse reqid when a ROUTED child_sa gets INSTALLED
fixed a bug in retransmission code
added support for the "keyingtries" ipsec.conf parameter
added support for the "dpddelay" ipsec.conf parameter
done some work for "dpdaction" behavior
some other cleanups and fixes
Diffstat (limited to 'src/charon/config/traffic_selector.c')
-rw-r--r-- | src/charon/config/traffic_selector.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/charon/config/traffic_selector.c b/src/charon/config/traffic_selector.c index 24cf7eaad..d8293b808 100644 --- a/src/charon/config/traffic_selector.c +++ b/src/charon/config/traffic_selector.c @@ -464,24 +464,16 @@ static u_int8_t get_protocol(private_traffic_selector_t *this) */ static void update_address_range(private_traffic_selector_t *this, host_t *host) { - if (host->get_family(host) == AF_INET && this->type == TS_IPV4_ADDR_RANGE) + if ((this->type == TS_IPV4_ADDR_RANGE && this->from4[0] == 0) || + (this->type == TS_IPV6_ADDR_RANGE && this->from6[0] == 0 && + this->from6[1] == 0 && this->from6[2] == 0 && this->from6[3] == 0)) { - if (this->from4[0] == 0) - { - chunk_t from = host->get_address(host); - memcpy(this->from4, from.ptr, from.len); - memcpy(this->to4, from.ptr, from.len); - } - } - if (host->get_family(host) == AF_INET6 && this->type == TS_IPV6_ADDR_RANGE) - { - if (this->from6[0] == 0 && this->from6[1] == 0 && - this->from6[2] == 0 && this->from6[3] == 0) - { - chunk_t from = host->get_address(host); - memcpy(this->from6, from.ptr, from.len); - memcpy(this->to6, from.ptr, from.len); - } + this->type = host->get_family(host) == AF_INET ? + TS_IPV4_ADDR_RANGE : TS_IPV6_ADDR_RANGE; + + chunk_t from = host->get_address(host); + memcpy(this->from, from.ptr, from.len); + memcpy(this->to, from.ptr, from.len); } update_string(this); } |