return nhrc;
}
-static int pbr_nhrc_hash_equal(const void *arg1, const void *arg2)
+static bool pbr_nhrc_hash_equal(const void *arg1, const void *arg2)
{
const struct nexthop *nh1, *nh2;
return key;
}
-static int pbr_nh_hash_equal(const void *arg1, const void *arg2)
+static bool pbr_nh_hash_equal(const void *arg1, const void *arg2)
{
const struct pbr_nexthop_cache *pbrnc1 =
(const struct pbr_nexthop_cache *)arg1;
(const struct pbr_nexthop_cache *)arg2;
if (pbrnc1->nexthop->vrf_id != pbrnc2->nexthop->vrf_id)
- return 0;
+ return false;
if (pbrnc1->nexthop->ifindex != pbrnc2->nexthop->ifindex)
- return 0;
+ return false;
if (pbrnc1->nexthop->type != pbrnc2->nexthop->type)
- return 0;
+ return false;
switch (pbrnc1->nexthop->type) {
case NEXTHOP_TYPE_IFINDEX:
- return 1;
+ return true;
case NEXTHOP_TYPE_IPV4_IFINDEX:
case NEXTHOP_TYPE_IPV4:
return pbrnc1->nexthop->gate.ipv4.s_addr
== pbrnc2->nexthop->gate.ipv4.s_addr;
case NEXTHOP_TYPE_IPV6_IFINDEX:
case NEXTHOP_TYPE_IPV6:
- return !memcmp(&pbrnc1->nexthop->gate.ipv6,
- &pbrnc2->nexthop->gate.ipv6, 16);
+ return !!memcmp(&pbrnc1->nexthop->gate.ipv6,
+ &pbrnc2->nexthop->gate.ipv6, 16);
case NEXTHOP_TYPE_BLACKHOLE:
return pbrnc1->nexthop->bh_type == pbrnc2->nexthop->bh_type;
}
/*
* We should not get here
*/
- return 0;
+ return false;
}
static void pbr_nhgc_delete(struct pbr_nexthop_group_cache *p)
return jhash(&nhgc->name, strlen(nhgc->name), 0x52c34a96);
}
-static int pbr_nhg_hash_equal(const void *arg1, const void *arg2)
+static bool pbr_nhg_hash_equal(const void *arg1, const void *arg2)
{
const struct pbr_nexthop_group_cache *nhgc1 =
(const struct pbr_nexthop_group_cache *)arg1;