diff options
author | Artem Glazychev <artem.glazychev@xored.com> | 2021-06-11 00:10:00 +0700 |
---|---|---|
committer | Ed Warnicke <hagbard@gmail.com> | 2021-10-06 21:32:33 +0000 |
commit | dd630d15d3e9d13da9ed98d3171b9ec4529e4e66 (patch) | |
tree | 83b14e2ccf510b8296919b30825af28c81c49c34 /src/plugins/wireguard/wireguard_output_tun.c | |
parent | 22efac3b537a3a1f0b57d5942bdb78c3190ce858 (diff) |
wireguard: add events for peer
we can receive events from peer about its state:
-WIREGUARD_PEER_STATUS_DEAD
-WIREGUARD_PEER_ESTABLISHED
Type: improvement
Change-Id: Ide83fbe2cfafa79ded5bcf3f6a884c26a7583db0
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Diffstat (limited to 'src/plugins/wireguard/wireguard_output_tun.c')
-rw-r--r-- | src/plugins/wireguard/wireguard_output_tun.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/wireguard/wireguard_output_tun.c b/src/plugins/wireguard/wireguard_output_tun.c index 80ba9504f0e..ec6cb7c6cfb 100644 --- a/src/plugins/wireguard/wireguard_output_tun.c +++ b/src/plugins/wireguard/wireguard_output_tun.c @@ -129,7 +129,7 @@ wg_output_tun_inline (vlib_main_t *vm, vlib_node_runtime_t *node, wg_peer_get_by_adj_index (vnet_buffer (b[0])->ip.adj_index[VLIB_TX]); peer = wg_peer_get (peeri); - if (!peer || peer->is_dead) + if (wg_peer_is_dead (peer)) { b[0]->error = node->errors[WG_OUTPUT_ERROR_PEER]; goto out; @@ -201,6 +201,7 @@ wg_output_tun_inline (vlib_main_t *vm, vlib_node_runtime_t *node, { //TODO: Maybe wrong wg_send_handshake_from_mt (peeri, false); + wg_peer_update_flags (peeri, WG_PEER_ESTABLISHED, false); goto out; } |