summaryrefslogtreecommitdiffstats
path: root/src/plugins/wireguard
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-09-14 13:28:42 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-09-15 08:39:03 +0000
commitec8a577ed98beb8ec88de57d39309af4f908eb01 (patch)
tree15ebeb26c8ddcef07a9514d5f061485a129a0db7 /src/plugins/wireguard
parenta238082a8a74aee63620df1c4151157dd0003087 (diff)
wireguard: coverity fixes
Type: fix Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Ib1eabbc87a573c660ac251602d631f167928259b (cherry picked from commit 76770fd659420c23e43422d672a55e268f042129)
Diffstat (limited to 'src/plugins/wireguard')
-rwxr-xr-xsrc/plugins/wireguard/wireguard_api.c4
-rw-r--r--src/plugins/wireguard/wireguard_if.c12
2 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/wireguard/wireguard_api.c b/src/plugins/wireguard/wireguard_api.c
index e107cb56b4b..8bbacddaf45 100755
--- a/src/plugins/wireguard/wireguard_api.c
+++ b/src/plugins/wireguard/wireguard_api.c
@@ -39,7 +39,7 @@ static void
wg_main_t *wmp = &wg_main;
u8 private_key[NOISE_PUBLIC_KEY_LEN];
ip_address_t src;
- u32 sw_if_index;
+ u32 sw_if_index = ~0;
int rv = 0;
ip_address_decode2 (&mp->interface.src_ip, &src);
@@ -140,7 +140,7 @@ vl_api_wireguard_peer_add_t_handler (vl_api_wireguard_peer_add_t * mp)
{
vl_api_wireguard_peer_add_reply_t *rmp;
wg_main_t *wmp = &wg_main;
- index_t peeri;
+ index_t peeri = INDEX_INVALID;
int ii, rv = 0;
ip_address_t endpoint;
diff --git a/src/plugins/wireguard/wireguard_if.c b/src/plugins/wireguard/wireguard_if.c
index ff8ed35477e..522e9b6665a 100644
--- a/src/plugins/wireguard/wireguard_if.c
+++ b/src/plugins/wireguard/wireguard_if.c
@@ -244,10 +244,14 @@ wg_if_create (u32 user_instance,
wg_if_index_by_port[port] = wg_if - wg_if_pool;
wg_if->port = port;
- struct noise_upcall upcall;
- upcall.u_remote_get = wg_remote_get;
- upcall.u_index_set = wg_index_set;
- upcall.u_index_drop = wg_index_drop;
+
+ /* *INDENT-OFF* */
+ struct noise_upcall upcall = {
+ .u_remote_get = wg_remote_get,
+ .u_index_set = wg_index_set,
+ .u_index_drop = wg_index_drop,
+ };
+ /* *INDENT-ON* */
noise_local_init (&wg_if->local, &upcall);
noise_local_set_private (&wg_if->local, private_key);