summaryrefslogtreecommitdiffstats
path: root/nhrpd
diff options
context:
space:
mode:
Diffstat (limited to 'nhrpd')
-rw-r--r--nhrpd/nhrp_cache.c4
-rw-r--r--nhrpd/nhrp_peer.c3
-rw-r--r--nhrpd/nhrp_vc.c3
-rw-r--r--nhrpd/reqid.c3
4 files changed, 9 insertions, 4 deletions
diff --git a/nhrpd/nhrp_cache.c b/nhrpd/nhrp_cache.c
index f3a33eb28..1316a4aad 100644
--- a/nhrpd/nhrp_cache.c
+++ b/nhrpd/nhrp_cache.c
@@ -36,10 +36,12 @@ static unsigned int nhrp_cache_protocol_key(void *peer_data)
return sockunion_hash(&p->remote_addr);
}
-static int nhrp_cache_protocol_cmp(const void *cache_data, const void *key_data)
+static bool nhrp_cache_protocol_cmp(const void *cache_data,
+ const void *key_data)
{
const struct nhrp_cache *a = cache_data;
const struct nhrp_cache *b = key_data;
+
return sockunion_same(&a->remote_addr, &b->remote_addr);
}
diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c
index 203d4aa98..db2f72ac2 100644
--- a/nhrpd/nhrp_peer.c
+++ b/nhrpd/nhrp_peer.c
@@ -157,10 +157,11 @@ static unsigned int nhrp_peer_key(void *peer_data)
return sockunion_hash(&p->vc->remote.nbma);
}
-static int nhrp_peer_cmp(const void *cache_data, const void *key_data)
+static bool nhrp_peer_cmp(const void *cache_data, const void *key_data)
{
const struct nhrp_peer *a = cache_data;
const struct nhrp_peer *b = key_data;
+
return a->ifp == b->ifp && a->vc == b->vc;
}
diff --git a/nhrpd/nhrp_vc.c b/nhrpd/nhrp_vc.c
index 41a87d4ad..79a655396 100644
--- a/nhrpd/nhrp_vc.c
+++ b/nhrpd/nhrp_vc.c
@@ -35,10 +35,11 @@ static unsigned int nhrp_vc_key(void *peer_data)
sockunion_hash(&vc->remote.nbma), 0);
}
-static int nhrp_vc_cmp(const void *cache_data, const void *key_data)
+static bool nhrp_vc_cmp(const void *cache_data, const void *key_data)
{
const struct nhrp_vc *a = cache_data;
const struct nhrp_vc *b = key_data;
+
return sockunion_same(&a->local.nbma, &b->local.nbma)
&& sockunion_same(&a->remote.nbma, &b->remote.nbma);
}
diff --git a/nhrpd/reqid.c b/nhrpd/reqid.c
index e8ad518e5..08a007bdf 100644
--- a/nhrpd/reqid.c
+++ b/nhrpd/reqid.c
@@ -8,9 +8,10 @@ static unsigned int nhrp_reqid_key(void *data)
return r->request_id;
}
-static int nhrp_reqid_cmp(const void *data, const void *key)
+static bool nhrp_reqid_cmp(const void *data, const void *key)
{
const struct nhrp_reqid *a = data, *b = key;
+
return a->request_id == b->request_id;
}