summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2024-11-21 15:30:41 +0100
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2024-11-21 21:43:16 +0100
commit4e49794fcf554b038b1f6613af7fec848f24cefe (patch)
treed152cb1b50b0aa2e4fe5e1436aae7de6d4304711 /src
parent1c8321a8679e132cec1b769ab364149e794558cc (diff)
downloadvyos-1x-4e49794fcf554b038b1f6613af7fec848f24cefe.tar.gz
vyos-1x-4e49794fcf554b038b1f6613af7fec848f24cefe.zip
dhcp: T6692: Fix range options not present when `exclude` is used
Add smoketest to verify range options are present with `exclude`
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/service_dhcp-server.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/conf_mode/service_dhcp-server.py b/src/conf_mode/service_dhcp-server.py
index e89448e2d..9c59aa63d 100755
--- a/src/conf_mode/service_dhcp-server.py
+++ b/src/conf_mode/service_dhcp-server.py
@@ -87,6 +87,10 @@ def dhcp_slice_range(exclude_list, range_dict):
'start' : range_start,
'stop' : str(ip_address(e) -1)
}
+
+ if 'option' in range_dict:
+ r['option'] = range_dict['option']
+
# On the next run our address range will start one address after
# the exclude address
range_start = str(ip_address(e) + 1)
@@ -104,6 +108,10 @@ def dhcp_slice_range(exclude_list, range_dict):
'start': str(ip_address(e) + 1),
'stop': str(range_stop)
}
+
+ if 'option' in range_dict:
+ r['option'] = range_dict['option']
+
if not (ip_address(r['start']) > ip_address(r['stop'])):
output.append(r)
else: