summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2024-01-22 21:44:50 +0100
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2024-01-22 21:44:50 +0100
commitf241dbd8dd2d93f126159947a43fd8ee6424f0af (patch)
treeaa7f2bea94927cc2aa4c3a8dacf26270243a24b3 /src
parentb61a06aa54657b9b128b0c6350b3cb861339ae9c (diff)
downloadvyos-1x-f241dbd8dd2d93f126159947a43fd8ee6424f0af.tar.gz
vyos-1x-f241dbd8dd2d93f126159947a43fd8ee6424f0af.zip
dhcp: T5787: Allow disabled duplicates on static-mapping (backport)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/service_dhcp-server.py9
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'])