From 46ee286753d10e0afe06fee6121519d57bb50793 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 28 Feb 2019 12:46:07 +0000 Subject: IPSEC: crash on SA dump when SA are bound to tunnels Change-Id: I1c8256af838e6d4f371549ca91b8b0a4c0c44c65 Signed-off-by: Neale Ranns --- src/vnet/ipsec/ipsec_api.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/vnet/ipsec/ipsec_api.c b/src/vnet/ipsec/ipsec_api.c index fc09f77db6c..0a8f0a17ddf 100644 --- a/src/vnet/ipsec/ipsec_api.c +++ b/src/vnet/ipsec/ipsec_api.c @@ -557,8 +557,11 @@ send_ipsec_sa_details (ipsec_sa_t * sa, vl_api_registration_t * reg, mp->total_data_size = clib_host_to_net_u64 (sa->total_data_size); mp->udp_encap = sa->udp_encap; - mp->tx_table_id = - htonl (fib_table_get_table_id (sa->tx_fib_index, FIB_PROTOCOL_IP4)); + if (~0 != sa->tx_fib_index) + mp->tx_table_id = + htonl (fib_table_get_table_id (sa->tx_fib_index, FIB_PROTOCOL_IP4)); + else + mp->tx_table_id = ~0; vl_api_send_msg (reg, (u8 *) mp); } -- cgit 1.2.3-korg