summaryrefslogtreecommitdiff
path: root/src/ipcpd/unicast
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipcpd/unicast')
-rw-r--r--src/ipcpd/unicast/ca/mb-ecn.c4
-rw-r--r--src/ipcpd/unicast/dir/dht.c10
-rw-r--r--src/ipcpd/unicast/fa.c2
-rw-r--r--src/ipcpd/unicast/main.c2
4 files changed, 10 insertions, 8 deletions
diff --git a/src/ipcpd/unicast/ca/mb-ecn.c b/src/ipcpd/unicast/ca/mb-ecn.c
index ed4bab12..d9a204b0 100644
--- a/src/ipcpd/unicast/ca/mb-ecn.c
+++ b/src/ipcpd/unicast/ca/mb-ecn.c
@@ -29,7 +29,7 @@
#include "config.h"
#include <ouroboros/ipcp-dev.h>
-#include <ouroboros/time_utils.h>
+#include <ouroboros/time.h>
#include "mb-ecn.h"
@@ -187,7 +187,7 @@ ca_wnd_t mb_ecn_ctx_update_snd(void * _ctx,
void mb_ecn_wnd_wait(ca_wnd_t wnd)
{
if (wnd.wait > 0) {
- struct timespec s = {0, 0};
+ struct timespec s = TIMESPEC_INIT_S(0);
if (wnd.wait > BILLION) /* Don't care throttling < 1s */
s.tv_sec = 1;
else
diff --git a/src/ipcpd/unicast/dir/dht.c b/src/ipcpd/unicast/dir/dht.c
index 65dad5a3..08a5a5a9 100644
--- a/src/ipcpd/unicast/dir/dht.c
+++ b/src/ipcpd/unicast/dir/dht.c
@@ -40,7 +40,7 @@
#include <ouroboros/list.h>
#include <ouroboros/notifier.h>
#include <ouroboros/random.h>
-#include <ouroboros/time_utils.h>
+#include <ouroboros/time.h>
#include <ouroboros/tpm.h>
#include <ouroboros/utils.h>
#include <ouroboros/pthread.h>
@@ -472,12 +472,14 @@ static void kad_req_destroy(struct kad_req * req)
static int kad_req_wait(struct kad_req * req,
time_t t)
{
- struct timespec timeo = {t, 0};
+ struct timespec timeo = TIMESPEC_INIT_S(0);
struct timespec abs;
int ret = 0;
assert(req);
+ timeo.tv_sec = t;
+
clock_gettime(PTHREAD_COND_CLOCK, &abs);
ts_add(&abs, &timeo, &abs);
@@ -995,7 +997,7 @@ static void cancel_lookup_wait(void * o)
static enum lookup_state lookup_wait(struct lookup * lu)
{
- struct timespec timeo = {KAD_T_RESP, 0};
+ struct timespec timeo = TIMESPEC_INIT_S(KAD_T_RESP);
struct timespec abs;
enum lookup_state state;
int ret = 0;
@@ -2764,7 +2766,7 @@ static void handle_event(void * self,
pthread_t thr;
struct join_info * inf;
struct conn * c = (struct conn *) o;
- struct timespec slack = {0, DHT_ENROLL_SLACK * MILLION};
+ struct timespec slack = TIMESPEC_INIT_MS(DHT_ENROLL_SLACK);
/* Give the pff some time to update for the new link. */
nanosleep(&slack, NULL);
diff --git a/src/ipcpd/unicast/fa.c b/src/ipcpd/unicast/fa.c
index c9f60587..cea9483e 100644
--- a/src/ipcpd/unicast/fa.c
+++ b/src/ipcpd/unicast/fa.c
@@ -878,7 +878,7 @@ int fa_dealloc(int fd)
pthread_rwlock_unlock(&fa.flows_lock);
- flow_dealloc(fd);
+ ipcp_flow_dealloc(fd);
return 0;
}
diff --git a/src/ipcpd/unicast/main.c b/src/ipcpd/unicast/main.c
index fed08d93..e6cb2994 100644
--- a/src/ipcpd/unicast/main.c
+++ b/src/ipcpd/unicast/main.c
@@ -37,7 +37,7 @@
#include <ouroboros/notifier.h>
#include <ouroboros/random.h>
#include <ouroboros/rib.h>
-#include <ouroboros/time_utils.h>
+#include <ouroboros/time.h>
#include "common/connmgr.h"
#include "common/enroll.h"