From 5d111c83ff2fb9fb1e094ccfdfa919a4731ec05b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 18 Aug 2014 22:01:38 +0200 Subject: peer: add a flag `dynamic' instead of checking the config field for NULL --- src/peer.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/peer.h') diff --git a/src/peer.h b/src/peer.h index 99d84f9..3451343 100644 --- a/src/peer.h +++ b/src/peer.h @@ -74,6 +74,8 @@ struct fastd_peer { struct timespec establish_handshake_timeout; /**< A timeout during which all handshakes for this peer will be ignored after a new connection has been established */ #ifdef WITH_VERIFY + bool dynamic; /**< Specifies if the peer has been added dynamically by a on-verify script */ + struct timespec verify_timeout; /**< Specifies the minimum time after which on-verify may be run again */ struct timespec verify_valid_timeout; /**< Specifies how long a peer stays valid after a successful on-verify run */ #endif @@ -228,8 +230,12 @@ static inline bool fastd_peer_is_floating(const fastd_peer_t *peer) { } /** Checks if a peer is not statically configured, but added after a on-verify run */ -static inline bool fastd_peer_is_dynamic(const fastd_peer_t *peer) { - return (!peer->config); +static inline bool fastd_peer_is_dynamic(const fastd_peer_t *peer UNUSED) { +#ifdef WITH_VERIFY + return peer->dynamic; +#else + return false; +#endif } /** Returns the currently active remote entry */ -- cgit v1.2.3