summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2024-05-11 13:10:44 +0200
committerUros Majstorovic <majstor@majstor.org>2024-05-11 13:10:44 +0200
commit320d6a8f68d4f32081006cda86f2a2bbd79c3f71 (patch)
treea4f649ef632ed8735b968fe62511108148c20f9e
parentdcc5330eefd12028b64acb03c832f5ff4764b7a8 (diff)
fixed library for no hashtable
-rw-r--r--ecp/src/ecp/core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ecp/src/ecp/core.c b/ecp/src/ecp/core.c
index 64f6730..357514c 100644
--- a/ecp/src/ecp/core.c
+++ b/ecp/src/ecp/core.c
@@ -304,7 +304,7 @@ static ECPConnection *conn_table_search_pub(ECPSocket *sock, unsigned char c_idx
if (c_idx & ~ECP_ECDH_IDX_MASK) continue;
_c_idx = c_idx % ECP_MAX_NODE_KEY;
- if (conn->rkey[_c_idx].valid && (memcmp(c_public, &conn->rkey[_c_idx].public, sizeof(conn->key[c_idx].public) == 0)) {
+ if (conn->rkey[_c_idx].valid && (memcmp(c_public, &conn->rkey[_c_idx].public, sizeof(conn->key[c_idx].public)) == 0)) {
return conn;
}
}
@@ -673,7 +673,7 @@ ECPConnection *ecp_sock_gct_search(ECPSocket *sock, ecp_ecdh_public_t *public) {
pthread_mutex_lock(&_conn->mutex);
#endif
- if (_ecp_conn_in_gct(_conn) && (memcmp(&_conn->remote.key_perma.public, public) == 0)) {
+ if (_ecp_conn_in_gct(_conn) && (memcmp(&_conn->remote.key_perma.public, public, sizeof(_conn->remote.key_perma.public)) == 0)) {
/* conn has to be registered to be in conn_table */
_conn->refcount++;
conn = _conn;
@@ -1265,7 +1265,7 @@ int ecp_conn_insert_gc(ECPConnection *conn) {
pthread_mutex_lock(&conn->mutex);
#endif
- if (!_ecp_conn_is_reg(conn)) rv = ECP_CONN_CLOSED;
+ if (!_ecp_conn_is_reg(conn)) rv = ECP_ERR_CLOSED;
if (!rv) _ecp_conn_push_gct(conn);
#ifdef ECP_WITH_PTHREAD