summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-03-29 02:17:48 +0100
committerGitHub <noreply@github.com>2024-03-29 02:17:48 +0100
commitb593eb5d7fd61bddeddcf300890521c1c1ec4335 (patch)
treefae80d9cac6f2a1f92c38f54bf50e03e3e4eb631 /python
parent5e72a71a9bbbef76bda47e34e911ac1fcc015b01 (diff)
parent7aa188ccc51acf4e86aa3b41cde26a0a8d938510 (diff)
downloadvyos-1x-b593eb5d7fd61bddeddcf300890521c1c1ec4335.tar.gz
vyos-1x-b593eb5d7fd61bddeddcf300890521c1c1ec4335.zip
Merge pull request #3196 from HollyGurza/T4718-sagitta
dhcp-server: T4718: Listen-address is not commited if the IP address is on the interface with a VRF
Diffstat (limited to 'python')
-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):