diff options
author | Tobias Brunner <tobias@strongswan.org> | 2014-10-28 18:23:10 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2014-10-30 12:32:45 +0100 |
commit | e0cd3bad3d40c71559adc23d340b6a6b170dabb0 (patch) | |
tree | 36533bb106a6998c23a7454df572377b48b438f5 | |
parent | 5e92534313ca6dcf60f59968cada8ca27e3f6565 (diff) | |
download | strongswan-e0cd3bad3d40c71559adc23d340b6a6b170dabb0.tar.bz2 strongswan-e0cd3bad3d40c71559adc23d340b6a6b170dabb0.tar.xz |
ike-cfg: Use host_create_from_range() helper
-rw-r--r-- | src/libcharon/config/ike_cfg.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/libcharon/config/ike_cfg.c b/src/libcharon/config/ike_cfg.c index 42a3e9057..9464ceb5d 100644 --- a/src/libcharon/config/ike_cfg.c +++ b/src/libcharon/config/ike_cfg.c @@ -459,25 +459,10 @@ static traffic_selector_t* make_range(char *str) { traffic_selector_t *ts; ts_type_t type; - char *pos; host_t *from, *to; - pos = strchr(str, '-'); - if (!pos) - { - return NULL; - } - to = host_create_from_string(pos + 1, 0); - if (!to) - { - return NULL; - } - str = strndup(str, pos - str); - from = host_create_from_string_and_family(str, to->get_family(to), 0); - free(str); - if (!from) + if (!host_create_from_range(str, &from, &to)) { - to->destroy(to); return NULL; } if (to->get_family(to) == AF_INET) |