Fix vpp crash bug while deleting dhcp client 55/19455/4
authorjackiechen1985 <xiaobo.chen@tieto.com>
Thu, 9 May 2019 08:57:16 +0000 (16:57 +0800)
committerNeale Ranns <nranns@cisco.com>
Thu, 23 May 2019 07:25:20 +0000 (07:25 +0000)
We must do lock fib while vrf id ~0, otherwise it crashes while unlocking fib.

Change-Id: Iec9754ccd67634a132bc5384a4f796d4a65943ae
Signed-off-by: jackiechen1985 <xiaobo.chen@tieto.com>
src/plugins/nat/nat.c
src/vnet/interface.api

index 0d909ce..9eb0384 100755 (executable)
@@ -830,6 +830,7 @@ snat_add_static_mapping (ip4_address_t l_addr, ip4_address_t e_addr,
        {
          fib_index = sm->inside_fib_index;
          vrf_id = sm->inside_vrf_id;
+         fib_table_lock (fib_index, FIB_PROTOCOL_IP4, FIB_SOURCE_PLUGIN_LOW);
        }
 
       if (!(out2in_only || identity_nat))
index 8c700e1..d30f1c2 100644 (file)
@@ -247,7 +247,7 @@ autoreply define sw_interface_add_del_address
     @param context - sender context, to match reply w/ request
     @param sw_if_index - index of the interface
     @param is_ipv6 - if non-zero ipv6, else ipv4
-    @param vrf_id - fib table/vrd id to associate the interface with
+    @param vrf_id - fib table/vrf id to associate the interface with
 */
 autoreply define sw_interface_set_table
 {