From 39e2ea03b20c3ba97e3955a5a5167763c021a86a Mon Sep 17 00:00:00 2001 From: "aiyion.prime" Date: Mon, 30 Jan 2017 16:43:12 +0100 Subject: [PATCH] fixed usage of size_t for time_t (now using difftime()), in order to make it compile on armhf architectures --- src/protocol_auth.c | 4 ++-- src/protocol_misc.c | 2 +- src/protocol_subnet.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 236ca4a1..f937f5aa 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -747,8 +747,8 @@ static void send_everything(connection_t *c) { for splay_each(node_t, n, node_tree) { if ((!n->status.reachable) && ((now.tv_sec - n->last_state_change) >= keylifetime*2)) { - logger(DEBUG_CONNECTIONS, LOG_INFO, "Not forwarding informations about %s to %s (%zu / %d)", n->name, - c->name, now.tv_sec - n->last_state_change, keylifetime); + logger(DEBUG_CONNECTIONS, LOG_INFO, "Not forwarding informations about %s to %s (%lf / %d)", n->name, + c->name, difftime(now.tv_sec, n->last_state_change), keylifetime); continue; } diff --git a/src/protocol_misc.c b/src/protocol_misc.c index 625c006f..d6b2a763 100644 --- a/src/protocol_misc.c +++ b/src/protocol_misc.c @@ -100,7 +100,7 @@ bool send_ping(connection_t *c) { c->status.pinged = true; c->last_ping_time = now; - return send_request(c, "%d %zu %ld", PING, c->last_ping_time.tv_sec, c->last_ping_time.tv_usec); + return send_request(c, "%d %lf %ld", PING, difftime(c->last_ping_time.tv_sec,0), c->last_ping_time.tv_usec); } bool ping_h(connection_t *c, const char *request) { diff --git a/src/protocol_subnet.c b/src/protocol_subnet.c index 44c46622..7f0a052c 100644 --- a/src/protocol_subnet.c +++ b/src/protocol_subnet.c @@ -120,7 +120,7 @@ bool add_subnet_h(connection_t *c, const char *request) { logger(DEBUG_ALWAYS, LOG_WARNING, "Ignoring unauthorized %s from %s (%s): %s", "ADD_SUBNET", c->name, c->hostname, subnetstr); if ((!owner->status.reachable) && ((now.tv_sec - owner->last_state_change) >= keylifetime*2)) { - logger(DEBUG_CONNECTIONS, LOG_INFO, "Not forwarding informations about %s to ALL (%zu / %d)", owner->name, now.tv_sec - owner->last_state_change, keylifetime); + logger(DEBUG_CONNECTIONS, LOG_INFO, "Not forwarding informations about %s to ALL (%lf / %d)", owner->name, difftime(now.tv_sec, owner->last_state_change), keylifetime); } else { forward_request(c, request); }