summaryrefslogtreecommitdiffstats
path: root/test/test_neighbor.py
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-09-23 11:25:21 +0000
committerOle Tr�an <otroan@employees.org>2020-10-08 09:04:05 +0000
commit22eefd79a1817ce6d0da3b20412eb61ce718cbaf (patch)
treea3b4145fcd57f4284e1823329586ec73bdc80397 /test/test_neighbor.py
parent47a3d9975fa3af7a7537b565d6511dadc0df61fb (diff)
ip-neighbor: Grat ARPs from different subnet are dropped
Type: test Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Id07e8981a903f11f50fb494a93d01815382025e4
Diffstat (limited to 'test/test_neighbor.py')
-rw-r--r--test/test_neighbor.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test_neighbor.py b/test/test_neighbor.py
index 1045f4ba1e9..dfefb151091 100644
--- a/test/test_neighbor.py
+++ b/test/test_neighbor.py
@@ -1435,6 +1435,7 @@ class ARPTestCase(VppTestCase):
# Generate some hosts on the LAN
#
self.pg1.generate_remote_hosts(4)
+ self.pg2.generate_remote_hosts(4)
#
# And an ARP entry
@@ -1526,6 +1527,36 @@ class ARPTestCase(VppTestCase):
self.pg1.sw_if_index,
self.pg1.remote_hosts[2].ip4))
+ #
+ # IP address in different subnets are not learnt
+ #
+ self.pg2.configure_ipv4_neighbors()
+
+ for op in ["is-at", "who-has"]:
+ p1 = [(Ether(dst="ff:ff:ff:ff:ff:ff",
+ src=self.pg2.remote_hosts[1].mac) /
+ ARP(op=op,
+ hwdst=self.pg2.local_mac,
+ hwsrc=self.pg2.remote_hosts[1].mac,
+ pdst=self.pg2.remote_hosts[1].ip4,
+ psrc=self.pg2.remote_hosts[1].ip4)),
+ (Ether(dst="ff:ff:ff:ff:ff:ff",
+ src=self.pg2.remote_hosts[1].mac) /
+ ARP(op=op,
+ hwdst="ff:ff:ff:ff:ff:ff",
+ hwsrc=self.pg2.remote_hosts[1].mac,
+ pdst=self.pg2.remote_hosts[1].ip4,
+ psrc=self.pg2.remote_hosts[1].ip4))]
+
+ self.send_and_assert_no_replies(self.pg1, p1)
+ self.assertFalse(find_nbr(self,
+ self.pg1.sw_if_index,
+ self.pg2.remote_hosts[1].ip4))
+
+ # they are all dropped because the subnet's don't match
+ self.assertEqual(4, self.statistics.get_err_counter(
+ "/err/arp-reply/IP4 destination address not local to subnet"))
+
def test_arp_incomplete(self):
""" Incomplete Entries """