diff options
author | Pavel Kotucek <pavel.kotucek@pantheon.tech> | 2018-11-14 09:24:16 +0100 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-11-21 09:23:07 +0000 |
commit | 18934e6d2b3b0b9dad286bd83cc42c66a7160284 (patch) | |
tree | 6e919009dd9193c77cb2dfd1cd41cd9bf127a649 /src/vnet | |
parent | 349f8caa054a656973e0b841c3ece75561ebf2f7 (diff) |
VPP-1309: fixed crash when listing ip arp after removing interface
Change-Id: I8f88214eab0535573863f31d2c21e2239a811921
Signed-off-by: Pavel Kotucek <pavel.kotucek@pantheon.tech>
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/ethernet/arp.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/vnet/ethernet/arp.c b/src/vnet/ethernet/arp.c index 549e05d889c..13b718d4c62 100644 --- a/src/vnet/ethernet/arp.c +++ b/src/vnet/ethernet/arp.c @@ -2609,6 +2609,30 @@ send_ip4_garp_w_addr (vlib_main_t * vm, } /* + * Remove any arp entries asociated with the specificed interface + */ +void +vnet_arp_delete_sw_interface (vnet_main_t * vnm, u32 sw_if_index, u32 is_add) +{ + if (!is_add && sw_if_index != ~0) + { + ethernet_arp_main_t *am = ðernet_arp_main; + ethernet_arp_ip4_entry_t *e; + /* *INDENT-OFF* */ + pool_foreach (e, am->ip4_entry_pool, ({ + if (e->sw_if_index != sw_if_index) + continue; + vnet_arp_set_ip4_over_ethernet_rpc_args_t args = { .sw_if_index = sw_if_index, + .a.ip4 = e->ip4_address }; + vnet_arp_unset_ip4_over_ethernet_internal (vnm, &args); + })); + /* *INDENT-ON* */ + } +} + +VNET_SW_INTERFACE_ADD_DEL_FUNCTION (vnet_arp_delete_sw_interface); + +/* * fd.io coding-style-patch-verification: ON * * Local Variables: |