summaryrefslogtreecommitdiffstats
path: root/src/peer.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-26 23:22:12 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-26 23:22:24 +0200
commit5871d08a3a519dbc54261c8a18e649ec9cc8bd7f (patch)
tree8c6ce34d5b0b9edec0abdacedbeec49efb969cd7 /src/peer.c
parent36690c7203f0e46665f328fbe82ae3bd573cc6ff (diff)
downloadfastd-5871d08a3a519dbc54261c8a18e649ec9cc8bd7f.tar
fastd-5871d08a3a519dbc54261c8a18e649ec9cc8bd7f.zip
Make on-verify support optional
Diffstat (limited to 'src/peer.c')
-rw-r--r--src/peer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/peer.c b/src/peer.c
index eef7d0f..662504d 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -683,6 +683,7 @@ fastd_peer_t* fastd_peer_add(fastd_peer_config_t *peer_conf) {
pr_verbose("adding peer %P (group `%s')", peer, peer->group->conf->name);
}
else {
+#ifdef WITH_VERIFY
if (!fastd_shell_command_isset(&conf.on_verify))
exit_bug("tried to add temporary peer without on-verify command");
@@ -692,6 +693,9 @@ fastd_peer_t* fastd_peer_add(fastd_peer_config_t *peer_conf) {
peer->verify_valid_timeout = ctx.now;
pr_debug("adding temporary peer");
+#else
+ exit_bug("temporary peers not supported");
+#endif
}
setup_peer(peer);
@@ -867,12 +871,14 @@ static bool maintain_peer(fastd_peer_t *peer) {
if (fastd_peer_is_temporary(peer) || fastd_peer_is_established(peer)) {
/* check for peer timeout */
if (fastd_timed_out(&peer->timeout)) {
+#ifdef WITH_VERIFY
if (fastd_peer_is_temporary(peer) &&
fastd_timed_out(&peer->verify_timeout) &&
fastd_timed_out(&peer->verify_valid_timeout)) {
fastd_peer_delete(peer);
return false;
}
+#endif
if (fastd_peer_is_established(peer))
fastd_peer_reset(peer);