aboutsummaryrefslogtreecommitdiffstats
path: root/test/bfd.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/bfd.py')
-rw-r--r--test/bfd.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/bfd.py b/test/bfd.py
index 57a5bd86751..5171681369c 100644
--- a/test/bfd.py
+++ b/test/bfd.py
@@ -111,14 +111,24 @@ class VppBFDUDPSession(VppObject):
def local_addr(self):
""" BFD session local address (VPP address) """
if self._local_addr is None:
- return self._interface.local_ip4
+ if self.af == AF_INET:
+ return self._interface.local_ip4
+ elif self.af == AF_INET6:
+ return self._interface.local_ip6
+ else:
+ raise Exception("Unexpected af %s' % af" % self.af)
return self._local_addr
@property
def local_addr_n(self):
""" BFD session local address (VPP address) - raw, suitable for API """
if self._local_addr is None:
- return self._interface.local_ip4n
+ if self.af == AF_INET:
+ return self._interface.local_ip4n
+ elif self.af == AF_INET6:
+ return self._interface.local_ip6n
+ else:
+ raise Exception("Unexpected af %s' % af" % self.af)
return self._local_addr_n
@property