From ea2104f18b26ce46f0d48eb953a98965b70bfe94 Mon Sep 17 00:00:00 2001 From: Jose Phillips Date: Thu, 18 Jan 2024 00:42:11 -0500 Subject: dhcp: T5952: Fix validate duplicate MAC Address on same subnet --- src/conf_mode/service_dhcp-server.py | 5 +++-- 1 file 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: -- cgit v1.2.3