summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip4_forward.c
diff options
context:
space:
mode:
authorPavel Kotucek <pkotucek@cisco.com>2017-06-14 13:56:55 +0200
committerPavel Kotucek <pkotucek@cisco.com>2017-06-23 08:11:59 +0200
commit9f5a2b6310ce5c8e59c32ca6f27d8a187b0e4346 (patch)
tree4b861426518389df6807e124130a5f8dd62a1e45 /src/vnet/ip/ip4_forward.c
parent39f92401c6b5d9bc070569c1332ffc1eacc77d68 (diff)
IP4/IP6 FIB: fix crash during interface delete
after deleting a sub interface with IP4/IP6 address vpp crash Change-Id: Ie768ca845b9e2394f61e2a8e9722a80a788746e7 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip4_forward.c')
-rwxr-xr-xsrc/vnet/ip/ip4_forward.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index f4ecc395ab1..8263e01c188 100755
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -1136,6 +1136,23 @@ ip4_sw_interface_add_del (vnet_main_t * vnm, u32 sw_if_index, u32 is_add)
vec_validate (im->fib_index_by_sw_if_index, sw_if_index);
vec_validate (im->mfib_index_by_sw_if_index, sw_if_index);
+ if (!is_add)
+ {
+ ip4_main_t *im4 = &ip4_main;
+ ip_lookup_main_t *lm4 = &im4->lookup_main;
+ ip_interface_address_t *ia = 0;
+ ip4_address_t *address;
+ vlib_main_t *vm = vlib_get_main ();
+
+ /* *INDENT-OFF* */
+ foreach_ip_interface_address (lm4, ia, sw_if_index, 1 /* honor unnumbered */,
+ ({
+ address = ip_interface_address_get_address (lm4, ia);
+ ip4_add_del_interface_address(vm, sw_if_index, address, ia->address_length, 1);
+ }));
+ /* *INDENT-ON* */
+ }
+
vnet_feature_enable_disable ("ip4-unicast", "ip4-drop", sw_if_index,
is_add, 0, 0);