summaryrefslogtreecommitdiffstats
path: root/src/peer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/peer.c')
-rw-r--r--src/peer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/peer.c b/src/peer.c
index 176b39c..20058fb 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -423,7 +423,7 @@ static void delete_peer(fastd_peer_t *peer) {
conf.protocol->free_peer_state(peer);
- if (!peer->config)
+ if (fastd_peer_is_dynamic(peer))
free(peer->protocol_config);
for (i = 0; i < VECTOR_LEN(peer->remotes); i++)
@@ -742,6 +742,8 @@ fastd_peer_t* fastd_peer_add(fastd_peer_config_t *peer_conf) {
if (!fastd_shell_command_isset(&conf.on_verify))
exit_bug("tried to add dynamic peer without on-verify command");
+ peer->dynamic = true;
+
peer->verify_timeout = ctx.now;
peer->verify_valid_timeout = ctx.now;