summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-12-23 08:58:55 +0100
committerChristian Poessinger <christian@poessinger.com>2019-12-23 08:58:55 +0100
commitc1993205d62033658b36e4ad4ad4bb62afc54ecc (patch)
tree7f5af03c2cf023d1261a9143e102c7d540f3e875 /python
parent81f67ca2bcf016ca7a0e021016d8945fc2e11002 (diff)
downloadvyos-1x-c1993205d62033658b36e4ad4ad4bb62afc54ecc.tar.gz
vyos-1x-c1993205d62033658b36e4ad4ad4bb62afc54ecc.zip
lldp: T1898: support multiple management addresses
- management-address is not a <multi/> node - added new vyos.validate.is_loopback_addr() function - returns true is address passed is a looback address
Diffstat (limited to 'python')
-rw-r--r--python/vyos/validate.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/vyos/validate.py b/python/vyos/validate.py
index 3f3166022..1ce5a8467 100644
--- a/python/vyos/validate.py
+++ b/python/vyos/validate.py
@@ -112,6 +112,12 @@ def is_addr_assigned(addr):
return False
+def is_loopback_addr(addr):
+ """
+ Check if supplied IPv4/IPv6 address is a loopback address
+ """
+ return ipaddress.ip_address(addr).is_loopback
+
def is_subnet_connected(subnet, primary=False):
"""
Verify is the given IPv4/IPv6 subnet is connected to any interface on this