From 4475652054616ded16485341b081abf42cc6c08e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 16 Dec 2013 19:27:07 +0100 Subject: resolve: save a timestamp in the resolve return to ensure we don't confuse remotes before and after reconfiguration --- src/fastd.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/fastd.h') diff --git a/src/fastd.h b/src/fastd.h index b170bb5..30e4bc4 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -80,6 +80,7 @@ union fastd_peer_address { struct fastd_resolve_return { fastd_remote_t *remote; + struct timespec resolve_time; fastd_peer_address_t addr; }; @@ -394,6 +395,10 @@ static inline bool timespec_after(const struct timespec *tp1, const struct times (tp1->tv_sec == tp2->tv_sec && tp1->tv_nsec > tp2->tv_nsec)); } +static inline bool timespec_equal(const struct timespec *tp1, const struct timespec *tp2) { + return (tp1->tv_sec == tp2->tv_sec && tp1->tv_nsec == tp2->tv_nsec); +} + /* returns (tp1 - tp2) in milliseconds */ static inline int timespec_diff(const struct timespec *tp1, const struct timespec *tp2) { return ((tp1->tv_sec - tp2->tv_sec))*1000 + (tp1->tv_nsec - tp2->tv_nsec)/1e6; -- cgit v1.2.3