summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Yu <michael.a.yu@nokia-sbell.com>2020-05-08 16:42:58 +0800
committerNeale Ranns <nranns@cisco.com>2020-05-10 08:09:56 +0000
commitbedf48a17cbac03684d28af5dfba099ea3fd9d3f (patch)
treeb5f9af3aa7d8d117228388a458116add7f5a74a9
parentcbe36e47b5647becc6c03a08e2745ee5ead5de20 (diff)
ip-neighbor: fix show ip neighbor issue
Fix the issue that vppctl show ip4{6} neighbor [interface] command can't show entries correctly, example: both ip4 and ip6 entries can be shown with command: vppctl show ip4 neighbor. Type: fix Signed-off-by: Michael Yu <michael.a.yu@nokia-sbell.com> Change-Id: I229368b71cd285adce994c8290cc9d7e4c4f5aa6 Signed-off-by: Michael Yu <michael.a.yu@nokia-sbell.com>
-rw-r--r--src/vnet/ip-neighbor/ip_neighbor.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/vnet/ip-neighbor/ip_neighbor.c b/src/vnet/ip-neighbor/ip_neighbor.c
index a0179f7f375..09b56058f72 100644
--- a/src/vnet/ip-neighbor/ip_neighbor.c
+++ b/src/vnet/ip-neighbor/ip_neighbor.c
@@ -821,12 +821,11 @@ ip_neighbor_entries (u32 sw_if_index, ip46_type_t type)
/* *INDENT-OFF* */
pool_foreach (ipn, ip_neighbor_pool,
({
- if (sw_if_index != ~0 &&
- ipn->ipn_key->ipnk_sw_if_index != sw_if_index &&
+ if ((sw_if_index == ~0 ||
+ ipn->ipn_key->ipnk_sw_if_index == sw_if_index) &&
(IP46_TYPE_ANY == type ||
- (ipn->ipn_key->ipnk_type == type)))
- continue;
- vec_add1 (ipnis, ip_neighbor_get_index(ipn));
+ ipn->ipn_key->ipnk_type == type))
+ vec_add1 (ipnis, ip_neighbor_get_index(ipn));
}));
/* *INDENT-ON* */