IPSEC: crash on SA dump when SA are bound to tunnels 34/17934/1
authorNeale Ranns <nranns@cisco.com>
Thu, 28 Feb 2019 12:46:07 +0000 (12:46 +0000)
committerNeale Ranns <nranns@cisco.com>
Thu, 28 Feb 2019 12:46:07 +0000 (12:46 +0000)
Change-Id: I1c8256af838e6d4f371549ca91b8b0a4c0c44c65
Signed-off-by: Neale Ranns <nranns@cisco.com>
src/vnet/ipsec/ipsec_api.c

index fc09f77..0a8f0a1 100644 (file)
@@ -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);
 }