aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-10-06 01:04:26 -0700
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-18 14:38:34 +0000
commita61ba6d1f9d619fe4884513eb05dc5948ab2a471 (patch)
treebbdfe30c033c6810208becf5a4ea31c309cdcfb2
parent95c5e32b16d5a9fe65b95c46ce638d5670a5a2ba (diff)
ip: Fix IP unnumbered dump of one interface
Type: fix Change-Id: I35fb6fdfba50c4a59cf1ffb94cb51487bcf5afc9 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit ac3e72cb9765f78f1cf03ff5d5ccd9ff944668b6)
-rw-r--r--src/vnet/ip/ip_api.c2
-rw-r--r--test/test_neighbor.py9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c
index c6d1a3cee29..39f24cb535d 100644
--- a/src/vnet/ip/ip_api.c
+++ b/src/vnet/ip/ip_api.c
@@ -986,7 +986,7 @@ vl_api_ip_unnumbered_dump_t_handler (vl_api_ip_unnumbered_dump_t * mp)
si = vnet_get_sw_interface (vnm, ntohl (mp->sw_if_index));
- if (!(si->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED))
+ if (si->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED)
{
send_ip_unnumbered_details (am, reg,
sw_if_index,
diff --git a/test/test_neighbor.py b/test/test_neighbor.py
index 69b00ea6ff2..81c3acb09a3 100644
--- a/test/test_neighbor.py
+++ b/test/test_neighbor.py
@@ -311,7 +311,16 @@ class ARPTestCase(VppTestCase):
#
self.pg2.set_unnumbered(self.pg1.sw_if_index)
+ #
+ # test the unnumbered dump both by all interfaces and just the enabled
+ # one
+ #
unnum = self.vapi.ip_unnumbered_dump()
+ self.assertTrue(len(unnum))
+ self.assertEqual(unnum[0].ip_sw_if_index, self.pg1.sw_if_index)
+ self.assertEqual(unnum[0].sw_if_index, self.pg2.sw_if_index)
+ unnum = self.vapi.ip_unnumbered_dump(self.pg2.sw_if_index)
+ self.assertTrue(len(unnum))
self.assertEqual(unnum[0].ip_sw_if_index, self.pg1.sw_if_index)
self.assertEqual(unnum[0].sw_if_index, self.pg2.sw_if_index)