diff options
author | Christian Breunig <christian@breunig.cc> | 2024-03-30 21:32:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-30 21:32:47 +0100 |
commit | 252d03d6e419aae14ae75caed38d1b1001c916a2 (patch) | |
tree | 750fad15556acda317c8f6381269db1fc74c0ada /python/vyos/utils | |
parent | 89a6299156b86ac838462fd60af196dcb0d8877c (diff) | |
parent | 0d82dfa3725a23969fd6ae02b76b135a29be6df3 (diff) | |
download | vyos-1x-252d03d6e419aae14ae75caed38d1b1001c916a2.tar.gz vyos-1x-252d03d6e419aae14ae75caed38d1b1001c916a2.zip |
Merge pull request #3195 from HollyGurza/T4718-current
dhcp-server: T4718: Listen-address is not commit if the ip address is on the interface with vrf
Diffstat (limited to 'python/vyos/utils')
-rw-r--r-- | python/vyos/utils/network.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/utils/network.py b/python/vyos/utils/network.py index cac59475d..829124b57 100644 --- a/python/vyos/utils/network.py +++ b/python/vyos/utils/network.py @@ -310,7 +310,7 @@ def is_ipv6_link_local(addr): return False -def is_addr_assigned(ip_address, vrf=None, return_ifname=False) -> bool | str: +def is_addr_assigned(ip_address, vrf=None, return_ifname=False, include_vrf=False) -> bool | str: """ Verify if the given IPv4/IPv6 address is assigned to any interface """ from netifaces import interfaces from vyos.utils.network import get_interface_config @@ -321,7 +321,7 @@ def is_addr_assigned(ip_address, vrf=None, return_ifname=False) -> bool | str: # 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): |