diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-08-18 22:01:38 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-08-18 22:01:38 +0200 |
commit | 5d111c83ff2fb9fb1e094ccfdfa919a4731ec05b (patch) | |
tree | 277a0d2b69cc2ba69cbeff2e6f4fbb4eb39080f0 /src/peer.h | |
parent | 2352e1a79e6f77cb894f5b65b1632e27cd0695a9 (diff) | |
download | fastd-5d111c83ff2fb9fb1e094ccfdfa919a4731ec05b.tar fastd-5d111c83ff2fb9fb1e094ccfdfa919a4731ec05b.zip |
peer: add a flag `dynamic' instead of checking the config field for NULL
Diffstat (limited to 'src/peer.h')
-rw-r--r-- | src/peer.h | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 */ |