diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-10-18 03:32:21 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-10-18 03:32:21 +0200 |
commit | 412e341def88b0734fbac2c2f19fcecf2486ee86 (patch) | |
tree | f4050b542181869766dbb437ed06ec08cde1f3cb /src/protocols | |
parent | df48485aeab897c50fd792a740d1a5aed4378fc9 (diff) | |
download | fastd-412e341def88b0734fbac2c2f19fcecf2486ee86.tar fastd-412e341def88b0734fbac2c2f19fcecf2486ee86.zip |
config: make on_up/down/establish/disestablish commands configurable per peer group
Diffstat (limited to 'src/protocols')
-rw-r--r-- | src/protocols/ec25519_fhmqvc/handshake.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/protocols/ec25519_fhmqvc/handshake.c b/src/protocols/ec25519_fhmqvc/handshake.c index 80dbd5c..cebf25e 100644 --- a/src/protocols/ec25519_fhmqvc/handshake.c +++ b/src/protocols/ec25519_fhmqvc/handshake.c @@ -512,8 +512,10 @@ void fastd_protocol_ec25519_fhmqvc_handshake_init(fastd_socket_t *sock, const fa fastd_handshake_add(&buffer, RECORD_SENDER_HANDSHAKE_KEY, PUBLICKEYBYTES, &ctx.protocol_state->handshake_key.key.public); - if (!peer || !fastd_peer_is_established(peer)) - fastd_peer_exec_shell_command(&conf.on_connect, peer, (local_addr && local_addr->sa.sa_family) ? local_addr : sock->bound_addr, remote_addr, false); + if (!peer || !fastd_peer_is_established(peer)) { + const fastd_shell_command_t *on_connect = container_of(fastd_peer_group_lookup_peer(peer, on_connect.command), fastd_shell_command_t, command); + fastd_peer_exec_shell_command(on_connect, peer, (local_addr && local_addr->sa.sa_family) ? local_addr : sock->bound_addr, remote_addr, false); + } fastd_send_handshake(sock, local_addr, remote_addr, peer, buffer.buffer); } |