aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_neighbor.py
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-06-07 18:09:49 -0700
committerOle Trøan <otroan@employees.org>2018-06-08 08:52:29 +0000
commit59ae61ee7587502c0446655ecbe3daa296498f56 (patch)
tree0004fa89526cd045e620a072d2a2c3eb85236c3f /test/vpp_neighbor.py
parent180f6476f8df860323e706674a18632ef0ab2d4d (diff)
Gratuitous ARP packet handling
only learn from a GARP packet if it is an update to an existing entry. Change-Id: I4c1b59cfedb911466e5e4c9756cf53a6676e1909 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'test/vpp_neighbor.py')
-rw-r--r--test/vpp_neighbor.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/vpp_neighbor.py b/test/vpp_neighbor.py
index e8ba3b28823..c08132d1d40 100644
--- a/test/vpp_neighbor.py
+++ b/test/vpp_neighbor.py
@@ -9,7 +9,7 @@ from vpp_object import *
from util import mactobinary
-def find_nbr(test, sw_if_index, ip_addr, is_static=0, inet=AF_INET):
+def find_nbr(test, sw_if_index, ip_addr, is_static=0, inet=AF_INET, mac=None):
nbrs = test.vapi.ip_neighbor_dump(sw_if_index,
is_ipv6=1 if AF_INET6 == inet else 0)
if inet == AF_INET:
@@ -21,7 +21,11 @@ def find_nbr(test, sw_if_index, ip_addr, is_static=0, inet=AF_INET):
for n in nbrs:
if nbr_addr == n.ip_address[:s] \
and is_static == n.is_static:
- return True
+ if mac:
+ if n.mac_address == mactobinary(mac):
+ return True
+ else:
+ return True
return False