aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/stroke
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-02-21 11:11:29 +0100
committerMartin Willi <martin@revosec.ch>2013-02-21 11:52:33 +0100
commitcd41b951ee44e3d405e8b380e957460babb72821 (patch)
tree6fa84b4b40be32037625f5dd87466f89a5c74744 /src/libcharon/plugins/stroke
parenta1db77de7c90bb80beaf2f7a1c6c3d8a1bba12c0 (diff)
downloadstrongswan-cd41b951ee44e3d405e8b380e957460babb72821.tar.bz2
strongswan-cd41b951ee44e3d405e8b380e957460babb72821.tar.xz
Pass complete port range over stroke interface for more flexibility
Diffstat (limited to 'src/libcharon/plugins/stroke')
-rw-r--r--src/libcharon/plugins/stroke/stroke_config.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/libcharon/plugins/stroke/stroke_config.c b/src/libcharon/plugins/stroke/stroke_config.c
index 70d6ce562..ed10bdb9f 100644
--- a/src/libcharon/plugins/stroke/stroke_config.c
+++ b/src/libcharon/plugins/stroke/stroke_config.c
@@ -873,21 +873,11 @@ static void add_ts(private_stroke_config_t *this,
stroke_end_t *end, child_cfg_t *child_cfg, bool local)
{
traffic_selector_t *ts;
- u_int16_t from_port, to_port;
-
- if (end->port)
- {
- from_port = to_port = end->port;
- }
- else
- {
- from_port = 0;
- to_port = 65535;
- }
if (end->tohost)
{
- ts = traffic_selector_create_dynamic(end->protocol, from_port, to_port);
+ ts = traffic_selector_create_dynamic(end->protocol,
+ end->from_port, end->to_port);
child_cfg->add_traffic_selector(child_cfg, local, ts);
}
else
@@ -900,7 +890,7 @@ static void add_ts(private_stroke_config_t *this,
if (net)
{
ts = traffic_selector_create_from_subnet(net, 0, end->protocol,
- from_port, to_port);
+ end->from_port, end->to_port);
child_cfg->add_traffic_selector(child_cfg, local, ts);
}
}
@@ -913,7 +903,7 @@ static void add_ts(private_stroke_config_t *this,
while (enumerator->enumerate(enumerator, &subnet))
{
ts = traffic_selector_create_from_cidr(subnet, end->protocol,
- from_port, to_port);
+ end->from_port, end->to_port);
if (ts)
{
child_cfg->add_traffic_selector(child_cfg, local, ts);