Don't compare ports when comparing cached routes.
authorTobias Brunner <tobias@strongswan.org>
Fri, 15 Jun 2012 09:43:21 +0000 (11:43 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 15 Jun 2012 14:44:07 +0000 (16:44 +0200)
At least src_ip has a port set sometimes.

src/libhydra/plugins/kernel_netlink/kernel_netlink_ipsec.c
src/libhydra/plugins/kernel_netlink/kernel_netlink_net.c
src/libhydra/plugins/kernel_pfkey/kernel_pfkey_ipsec.c

index d0076b5..63f8894 100644 (file)
@@ -344,8 +344,8 @@ static void route_entry_destroy(route_entry_t *this)
 static bool route_entry_equals(route_entry_t *a, route_entry_t *b)
 {
        return a->if_name && b->if_name && streq(a->if_name, b->if_name) &&
-                  a->src_ip->equals(a->src_ip, b->src_ip) &&
-                  a->gateway->equals(a->gateway, b->gateway) &&
+                  a->src_ip->ip_equals(a->src_ip, b->src_ip) &&
+                  a->gateway->ip_equals(a->gateway, b->gateway) &&
                   chunk_equals(a->dst_net, b->dst_net) && a->prefixlen == b->prefixlen;
 }
 
index a13cfc7..828422e 100644 (file)
@@ -186,8 +186,8 @@ static u_int route_entry_hash(route_entry_t *this)
 static bool route_entry_equals(route_entry_t *a, route_entry_t *b)
 {
        return a->if_name && b->if_name && streq(a->if_name, b->if_name) &&
-                  a->src_ip->equals(a->src_ip, b->src_ip) &&
-                  a->gateway->equals(a->gateway, b->gateway) &&
+                  a->src_ip->ip_equals(a->src_ip, b->src_ip) &&
+                  a->gateway->ip_equals(a->gateway, b->gateway) &&
                   chunk_equals(a->dst_net, b->dst_net) && a->prefixlen == b->prefixlen;
 }
 
index 8ad6748..c39ebbd 100644 (file)
@@ -238,8 +238,8 @@ static void route_entry_destroy(route_entry_t *this)
 static bool route_entry_equals(route_entry_t *a, route_entry_t *b)
 {
        return a->if_name && b->if_name && streq(a->if_name, b->if_name) &&
-                  a->src_ip->equals(a->src_ip, b->src_ip) &&
-                  a->gateway->equals(a->gateway, b->gateway) &&
+                  a->src_ip->ip_equals(a->src_ip, b->src_ip) &&
+                  a->gateway->ip_equals(a->gateway, b->gateway) &&
                   chunk_equals(a->dst_net, b->dst_net) && a->prefixlen == b->prefixlen;
 }