summaryrefslogtreecommitdiff
path: root/python/vyos/utils/network.py
diff options
context:
space:
mode:
authorkhramshinr <khramshinr@gmail.com>2024-03-28 17:14:59 +0800
committerkhramshinr <khramshinr@gmail.com>2024-03-28 17:14:59 +0800
commit7aa188ccc51acf4e86aa3b41cde26a0a8d938510 (patch)
tree6fd05cc4a1229a91438681b60b2b5f282d4eee37 /python/vyos/utils/network.py
parent25891616fd74013241dc755166c7e3ad732849cc (diff)
downloadvyos-1x-7aa188ccc51acf4e86aa3b41cde26a0a8d938510.tar.gz
vyos-1x-7aa188ccc51acf4e86aa3b41cde26a0a8d938510.zip
dhcp-server: T4718: Listen-address is not commit if the ip address is on the interface with vrf
Diffstat (limited to 'python/vyos/utils/network.py')
-rw-r--r--python/vyos/utils/network.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/utils/network.py b/python/vyos/utils/network.py
index b58e02d91..63c9e263d 100644
--- a/python/vyos/utils/network.py
+++ b/python/vyos/utils/network.py
@@ -307,7 +307,7 @@ def is_ipv6_link_local(addr):
return False
-def is_addr_assigned(ip_address, vrf=None) -> bool:
+def is_addr_assigned(ip_address, vrf=None, include_vrf=False) -> bool:
""" Verify if the given IPv4/IPv6 address is assigned to any interface """
from netifaces import interfaces
from vyos.utils.network import get_interface_config
@@ -318,7 +318,7 @@ def is_addr_assigned(ip_address, vrf=None) -> bool:
# case there is no need to proceed with this data set - continue loop
# with next element
tmp = get_interface_config(interface)
- if dict_search('master', tmp) != vrf:
+ if dict_search('master', tmp) != vrf and not include_vrf:
continue
if is_intf_addr_assigned(interface, ip_address):