diff options
author | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-03-01 10:48:08 +0000 |
---|---|---|
committer | Rene Mayrhofer <rene@mayrhofer.eu.org> | 2009-03-01 10:48:08 +0000 |
commit | a6f902baed7abb17a1a9c014e01bb100077f8198 (patch) | |
tree | 82114e22e251e9260d9a712f1232e52e1ef494e3 /src/charon/config/traffic_selector.c | |
parent | 1450c9df799b0870477f6e63357f4bcb63537f4f (diff) | |
download | vyos-strongswan-a6f902baed7abb17a1a9c014e01bb100077f8198.tar.gz vyos-strongswan-a6f902baed7abb17a1a9c014e01bb100077f8198.zip |
- Updated to new upstream revision.
Diffstat (limited to 'src/charon/config/traffic_selector.c')
-rw-r--r-- | src/charon/config/traffic_selector.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/charon/config/traffic_selector.c b/src/charon/config/traffic_selector.c index d4235c32a..7442fc7ef 100644 --- a/src/charon/config/traffic_selector.c +++ b/src/charon/config/traffic_selector.c @@ -14,7 +14,7 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * - * $Id: traffic_selector.c 4639 2008-11-12 15:09:24Z martin $ + * $Id: traffic_selector.c 4860 2009-02-11 13:09:52Z martin $ */ #include <arpa/inet.h> @@ -196,8 +196,7 @@ static int print(FILE *stream, const struct printf_info *info, memeq(this->from, from, this->type == TS_IPV4_ADDR_RANGE ? 4 : 16) && memeq(this->to, to, this->type == TS_IPV4_ADDR_RANGE ? 4 : 16)) { - written += fprintf(stream, "dynamic/%d", - this->type == TS_IPV4_ADDR_RANGE ? 32 : 128); + written += fprintf(stream, "dynamic"); } else { @@ -521,9 +520,17 @@ static void set_address(private_traffic_selector_t *this, host_t *host) 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); + if (host->is_anyaddr(host)) + { + memset(this->from6, 0x00, sizeof(this->from6)); + memset(this->to6, 0xFF, sizeof(this->to6)); + } + else + { + chunk_t from = host->get_address(host); + memcpy(this->from, from.ptr, from.len); + memcpy(this->to, from.ptr, from.len); + } } } |