diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-09-04 20:57:33 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-09-04 20:57:33 +0200 |
commit | e9b472dc9e31def5c8559c6d007fdf770d99d308 (patch) | |
tree | cef4bfba8c59ad8c77be8a63abab760029b8c5b2 /src/protocols | |
parent | b54f78558b4efc72f22e525369761f130ad34f4e (diff) | |
download | fastd-e9b472dc9e31def5c8559c6d007fdf770d99d308.tar fastd-e9b472dc9e31def5c8559c6d007fdf770d99d308.zip |
config: allow moving the 'on verify' clause into a peer group
Diffstat (limited to 'src/protocols')
-rw-r--r-- | src/protocols/ec25519_fhmqvc/handshake.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/protocols/ec25519_fhmqvc/handshake.c b/src/protocols/ec25519_fhmqvc/handshake.c index bef4385..0cbe15a 100644 --- a/src/protocols/ec25519_fhmqvc/handshake.c +++ b/src/protocols/ec25519_fhmqvc/handshake.c @@ -565,12 +565,18 @@ static fastd_peer_t * add_dynamic(fastd_socket_t *sock, const fastd_peer_address } fastd_peer_t *peer = fastd_new0(fastd_peer_t); - peer->group = conf.peer_group; + peer->group = conf.on_verify_group; peer->config_state = CONFIG_DYNAMIC; peer->key = fastd_new(fastd_protocol_key_t); *peer->key = peer_key; + if (!fastd_peer_may_connect(peer)) { + pr_debug("not adding dynamic peer %P[%I] because of local constraints", peer, addr); + fastd_peer_free(peer); + return NULL; + } + if (!fastd_peer_add(peer)) exit_bug("failed to add dynamic peer"); |