kernel-netlink: Properly compare routes for policies without gateway/netxhop
This happened when installing a duplicate bypass policy for a locally connected subnet. The destructor and the kernel-net part already handle this correctly.
This commit is contained in:
@@ -409,10 +409,14 @@ static void route_entry_destroy(route_entry_t *this)
|
|||||||
*/
|
*/
|
||||||
static bool route_entry_equals(route_entry_t *a, route_entry_t *b)
|
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) &&
|
if (a->if_name && b->if_name && streq(a->if_name, b->if_name) &&
|
||||||
a->src_ip->ip_equals(a->src_ip, b->src_ip) &&
|
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)
|
||||||
chunk_equals(a->dst_net, b->dst_net) && a->prefixlen == b->prefixlen;
|
{
|
||||||
|
return (!a->gateway && !b->gateway) || (a->gateway && b->gateway &&
|
||||||
|
a->gateway->ip_equals(a->gateway, b->gateway));
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct ipsec_sa_t ipsec_sa_t;
|
typedef struct ipsec_sa_t ipsec_sa_t;
|
||||||
|
|||||||
Reference in New Issue
Block a user