diff options
author | Jose Phillips <jose@latinol.com> | 2024-01-18 00:42:11 -0500 |
---|---|---|
committer | Jose Phillips <jose@latinol.com> | 2024-01-18 00:42:11 -0500 |
commit | ea2104f18b26ce46f0d48eb953a98965b70bfe94 (patch) | |
tree | 372caa1709446b27654a752416246d23c597164b /src | |
parent | 62a8ef29d6238d5b777c3e946c132aca16a813c3 (diff) | |
download | vyos-1x-ea2104f18b26ce46f0d48eb953a98965b70bfe94.tar.gz vyos-1x-ea2104f18b26ce46f0d48eb953a98965b70bfe94.zip |
dhcp: T5952: Fix validate duplicate MAC Address on same subnet
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/service_dhcp-server.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/service_dhcp-server.py b/src/conf_mode/service_dhcp-server.py index b11fa7c1a..4c0d2cb0c 100755 --- a/src/conf_mode/service_dhcp-server.py +++ b/src/conf_mode/service_dhcp-server.py @@ -247,13 +247,14 @@ def verify(dhcp): if mapping_config['ip_address'] in used_ips: raise ConfigError(f'Configured IP address for static mapping "{mapping}" exists on another static mapping') + used_ips.append(mapping_config['ip_address']) + if 'mac' in mapping_config: if mapping_config['mac'] in used_mac: raise ConfigError(f'Configured MAC address for static mapping "{mapping}" exists on another static mapping') - - used_ips.append(mapping_config['ip_address']) used_mac.append(mapping_config['mac']) + # There must be one subnet connected to a listen interface. # This only counts if the network itself is not disabled! if 'disable' not in network_config: |