summaryrefslogtreecommitdiffstats
path: root/src/plugins/wireguard/wireguard_input.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-09-10 08:49:10 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-09-16 11:03:59 +0000
commit6efd393965317d7c27fbd0a7f0046a7b29d37a9e (patch)
tree0503316c602505126a03ebc49b85b9ffc2377018 /src/plugins/wireguard/wireguard_input.c
parent21cbdc75f21cde6ea83382e647c9da081d7d5f5b (diff)
wireguard: Fix for tunnel encap
Type: fix add UT for sneding handshale init and transport packets Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Iab1ed8864c666d5a0ae0b2364a9ca4de3c8770dc (cherry picked from commit d75a2d12c431fcffba2a2b4d59f18c9cec483ed9)
Diffstat (limited to 'src/plugins/wireguard/wireguard_input.c')
-rwxr-xr-xsrc/plugins/wireguard/wireguard_input.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/wireguard/wireguard_input.c b/src/plugins/wireguard/wireguard_input.c
index 832ad031daa..cdd65f87b51 100755
--- a/src/plugins/wireguard/wireguard_input.c
+++ b/src/plugins/wireguard/wireguard_input.c
@@ -313,12 +313,12 @@ VLIB_NODE_FN (wg_input_node) (vlib_main_t * vm,
if (entry)
{
peer = pool_elt_at_index (wmp->peers, *entry);
- if (!peer)
- {
- next[0] = WG_INPUT_NEXT_ERROR;
- b[0]->error = node->errors[WG_INPUT_ERROR_PEER];
- goto out;
- }
+ }
+ else
+ {
+ next[0] = WG_INPUT_NEXT_ERROR;
+ b[0]->error = node->errors[WG_INPUT_ERROR_PEER];
+ goto out;
}
u16 encr_len = b[0]->current_length - sizeof (message_data_t);