diff options
author | Christian Breunig <christian@breunig.cc> | 2024-01-22 22:28:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-22 22:28:26 +0100 |
commit | c0d70f697905dfa131be6cd9b2d48c07b915123f (patch) | |
tree | 669e68ff0b38a3c2d1f567c3b7185b1ee4d3f54e /src/conf_mode/service_dhcp-server.py | |
parent | 7d6002b9f8e422c8070413341bbc88db6a4fd8af (diff) | |
parent | f241dbd8dd2d93f126159947a43fd8ee6424f0af (diff) | |
download | vyos-1x-c0d70f697905dfa131be6cd9b2d48c07b915123f.tar.gz vyos-1x-c0d70f697905dfa131be6cd9b2d48c07b915123f.zip |
Merge pull request #2880 from sarthurdev/T5787_disabledbp
dhcp: T5787: Allow disabled duplicates on static-mapping (backport)
Diffstat (limited to 'src/conf_mode/service_dhcp-server.py')
-rwxr-xr-x | src/conf_mode/service_dhcp-server.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/conf_mode/service_dhcp-server.py b/src/conf_mode/service_dhcp-server.py index 341b31dd7..90056887a 100755 --- a/src/conf_mode/service_dhcp-server.py +++ b/src/conf_mode/service_dhcp-server.py @@ -236,11 +236,12 @@ def verify(dhcp): raise ConfigError(f'MAC address required for static mapping "{mapping}"\n' \ f'within shared-network "{network}, {subnet}"!') - if mapping_config['ip_address'] in used_ips: - raise ConfigError(f'Configured IP address for static mapping "{mapping}" already exists on another static mapping') - used_ips.append(mapping_config['ip_address']) + if 'disable' not in mapping_config: + if mapping_config['ip_address'] in used_ips: + raise ConfigError(f'Configured IP address for static mapping "{mapping}" already exists on another static mapping') + used_ips.append(mapping_config['ip_address']) - if 'mac_address' in mapping_config: + if 'mac_address' in mapping_config and 'disable' not in mapping_config: if mapping_config['mac_address'] in used_mac: raise ConfigError(f'Configured MAC address for static mapping "{mapping}" already exists on another static mapping') used_mac.append(mapping_config['mac_address']) |