ike-cfg: Use host_create_from_range() helper

This commit is contained in:
Tobias Brunner 2014-10-28 18:23:10 +01:00
parent 5e92534313
commit e0cd3bad3d
1 changed files with 1 additions and 16 deletions

View File

@ -459,27 +459,12 @@ 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)
if (!host_create_from_range(str, &from, &to))
{
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)
{
to->destroy(to);
return NULL;
}
if (to->get_family(to) == AF_INET)
{
type = TS_IPV4_ADDR_RANGE;