diff options
author | Christian Breunig <christian@breunig.cc> | 2024-01-10 18:28:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-10 18:28:18 +0100 |
commit | 085a15059755cd4724adfc8ffb64f35760c07e0f (patch) | |
tree | 6066419954faa3bc5c8b883ef2376a435e9b969d /python/vyos/utils | |
parent | f00779b36af8e282b453bebb1c80e5e619d1e478 (diff) | |
parent | 41913f4d1d63ddd39d9125b0140b8a33449c2cfb (diff) | |
download | vyos-1x-085a15059755cd4724adfc8ffb64f35760c07e0f.tar.gz vyos-1x-085a15059755cd4724adfc8ffb64f35760c07e0f.zip |
Merge pull request #2785 from sarthurdev/kea-options
dhcp: T3316: T5787: T5912: Extend scope of DHCP options, bugfixes
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 997ee6309..b782e0bd8 100644 --- a/python/vyos/utils/network.py +++ b/python/vyos/utils/network.py @@ -308,7 +308,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, return_ifname=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 @@ -323,7 +323,7 @@ def is_addr_assigned(ip_address, vrf=None) -> bool: continue if is_intf_addr_assigned(interface, ip_address): - return True + return interface if return_ifname else True return False |