aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-01-14 13:22:19 +0100
committerMartin Willi <martin@revosec.ch>2011-01-14 13:24:08 +0100
commit64e06d4f8fb72812e860be2bbd1d4d7282b90bc5 (patch)
tree5173c3705825e3765d58030e60d035e17b68c81d
parent983a5e88d330e28ec6b9726a365e372d3461141f (diff)
downloadstrongswan-64e06d4f8fb72812e860be2bbd1d4d7282b90bc5.tar.bz2
strongswan-64e06d4f8fb72812e860be2bbd1d4d7282b90bc5.tar.xz
Compare ending address in ts->equals, fixes redundant traffic selector elimination
-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 68bbbe2fd..32da194ef 100644
--- a/src/libstrongswan/selectors/traffic_selector.c
+++ b/src/libstrongswan/selectors/traffic_selector.c
@@ -393,13 +393,15 @@ static bool equals(private_traffic_selector_t *this, private_traffic_selector_t
switch (this->type)
{
case TS_IPV4_ADDR_RANGE:
- if (memeq(this->from4, other->from4, sizeof(this->from4)))
+ if (memeq(this->from4, other->from4, sizeof(this->from4)) &&
+ memeq(this->to4, other->to4, sizeof(this->to4)))
{
return TRUE;
}
break;
case TS_IPV6_ADDR_RANGE:
- if (memeq(this->from6, other->from6, sizeof(this->from6)))
+ if (memeq(this->from6, other->from6, sizeof(this->from6)) &&
+ memeq(this->to6, other->to6, sizeof(this->to6)))
{
return TRUE;
}