aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-11-15 15:03:27 +0000
committerDave Barach <openvpp@barachs.net>2019-11-18 12:48:32 +0000
commitd14fccd6d51569b0f025af57c830b873afcc18e3 (patch)
treef5c8d3c89517074234ef53458fd28f9ee5762e3a /src/vnet/ipsec/ipsec_api.c
parent210c74531c57a5d2ef721508d4c63aab873f61dc (diff)
ipsec: Coverity warnings
Type: fix Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I6bb6c6be62f98ac9a059469c81a5f4476b96e96e
Diffstat (limited to 'src/vnet/ipsec/ipsec_api.c')
-rw-r--r--src/vnet/ipsec/ipsec_api.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/vnet/ipsec/ipsec_api.c b/src/vnet/ipsec/ipsec_api.c
index b1b6db7e290..a959ac643ec 100644
--- a/src/vnet/ipsec/ipsec_api.c
+++ b/src/vnet/ipsec/ipsec_api.c
@@ -842,17 +842,24 @@ vl_api_ipsec_tunnel_if_add_del_t_handler (vl_api_ipsec_tunnel_if_add_del_t *
}
else
{
-
+ /* *INDENT-OFF* */
ipip_tunnel_key_t key = {
.transport = transport,
.fib_index = fib_index,
.src = local_ip,
.dst = remote_ip
};
+ /* *INDENT-ON* */
+
ipip_tunnel_t *t = ipip_tunnel_db_find (&key);
- rv = ipsec_tun_protect_del (t->sw_if_index);
- ipip_del_tunnel (t->sw_if_index);
+ if (NULL != t)
+ {
+ rv = ipsec_tun_protect_del (t->sw_if_index);
+ ipip_del_tunnel (t->sw_if_index);
+ }
+ else
+ rv = VNET_API_ERROR_NO_SUCH_ENTRY;
}
#else