aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2009-12-22 09:53:53 +0100
committerAndreas Steffen <andreas.steffen@strongswan.org>2009-12-22 09:53:53 +0100
commit7686f981a4fafbe29ac27da9eb4bb50fece0dad8 (patch)
tree5c045d8d538df4ca94e2221b8a04e04b40ce0ee6 /src
parent194c3cedc570a7f53a189922163dbae33fa1a2ea (diff)
downloadstrongswan-7686f981a4fafbe29ac27da9eb4bb50fece0dad8.tar.bz2
strongswan-7686f981a4fafbe29ac27da9eb4bb50fece0dad8.tar.xz
cosmetics
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/selectors/traffic_selector.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstrongswan/selectors/traffic_selector.c b/src/libstrongswan/selectors/traffic_selector.c
index ce2f67b5d..87e3464f6 100644
--- a/src/libstrongswan/selectors/traffic_selector.c
+++ b/src/libstrongswan/selectors/traffic_selector.c
@@ -21,7 +21,7 @@
#include <stdio.h>
#include "traffic_selector.h"
-#include "debug.h"
+
#include <utils/linked_list.h>
#include <utils/identification.h>
@@ -739,8 +739,10 @@ traffic_selector_t *traffic_selector_create_from_rfc3779_format(ts_type_t type,
}
if (to.len > 1)
{
+ u_int8_t mask = to.ptr[0] ? (1 << to.ptr[0]) - 1 : 0;
+
memcpy(this->to, to.ptr+1, to.len-1);
- this->to[to.len-2] |= to.ptr[0] ? (1 << to.ptr[0]) - 1 : 0;
+ this->to[to.len-2] |= mask;
}
this->netbits = chunk_equals(from, to) ? (from.len-1)*8 - from.ptr[0]
: NON_SUBNET_ADDRESS_RANGE;