aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/wireguard/wireguard_input.c
diff options
context:
space:
mode:
authorArtem Glazychev <artem.glazychev@xored.com>2021-02-17 13:24:17 +0700
committerDamjan Marion <dmarion@me.com>2021-02-24 14:22:49 +0000
commitcb1c4902bbc29d2bec2862c385659c682aa3984e (patch)
tree2b9d28cbfbbd550ea070d44b2d8cd2ed4ba942a8 /src/plugins/wireguard/wireguard_input.c
parent63ab85130cc3a5f52a5ee6b8f9c9bc6e9a2fcd72 (diff)
wireguard: coverity fix
explicit null dereferenced Type: fix Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Change-Id: Id1e4b0e048dbd0a68063c63374172ab6d3653aff
Diffstat (limited to 'src/plugins/wireguard/wireguard_input.c')
-rw-r--r--[-rwxr-xr-x]src/plugins/wireguard/wireguard_input.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/plugins/wireguard/wireguard_input.c b/src/plugins/wireguard/wireguard_input.c
index 2690cf5e097..5db814292f8 100755..100644
--- a/src/plugins/wireguard/wireguard_input.c
+++ b/src/plugins/wireguard/wireguard_input.c
@@ -22,16 +22,17 @@
#include <wireguard/wireguard_send.h>
#include <wireguard/wireguard_if.h>
-#define foreach_wg_input_error \
- _(NONE, "No error") \
- _(HANDSHAKE_MAC, "Invalid MAC handshake") \
- _(PEER, "Peer error") \
- _(INTERFACE, "Interface error") \
- _(DECRYPTION, "Failed during decryption") \
- _(KEEPALIVE_SEND, "Failed while sending Keepalive") \
- _(HANDSHAKE_SEND, "Failed while sending Handshake") \
- _(TOO_BIG, "Packet too big") \
- _(UNDEFINED, "Undefined error")
+#define foreach_wg_input_error \
+ _ (NONE, "No error") \
+ _ (HANDSHAKE_MAC, "Invalid MAC handshake") \
+ _ (PEER, "Peer error") \
+ _ (INTERFACE, "Interface error") \
+ _ (DECRYPTION, "Failed during decryption") \
+ _ (KEEPALIVE_SEND, "Failed while sending Keepalive") \
+ _ (HANDSHAKE_SEND, "Failed while sending Handshake") \
+ _ (HANDSHAKE_RECEIVE, "Failed while receiving Handshake") \
+ _ (TOO_BIG, "Packet too big") \
+ _ (UNDEFINED, "Undefined error")
typedef enum
{
@@ -245,7 +246,7 @@ wg_handshake_process (vlib_main_t * vm, wg_main_t * wmp, vlib_buffer_t * b)
break;
}
default:
- break;
+ return WG_INPUT_ERROR_HANDSHAKE_RECEIVE;
}
wg_timers_any_authenticated_packet_received (peer);