From 1887d3a78ce9e6b040eb3ac1300069aca38ca0f6 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 19 Oct 2019 10:11:46 +0200 Subject: dhcp-server: T1745: bugfix corner case on static-assignments There was a bug when refactoring this with commits 5848a4d ("dhcp-server: T1707: remove DHCP static-mappings from address pool") and 1182b44 ("dhcp-server: T1707: bugfix on subsequent DHCP exclude addresses") that when a static address assignemnt was using the last IP address from the specified range. This triggered the following error: "DHCP range stop address x must be greater or equal to the range start address y!" (cherry picked from commit 735d73e162634d598aa6b8ee13197aa231eefedb) --- src/conf_mode/dhcp_server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/conf_mode') diff --git a/src/conf_mode/dhcp_server.py b/src/conf_mode/dhcp_server.py index 504a9c35e..51cb7df3d 100755 --- a/src/conf_mode/dhcp_server.py +++ b/src/conf_mode/dhcp_server.py @@ -301,7 +301,8 @@ def dhcp_slice_range(exclude_list, range_list): 'start': str(ip_address(e) + 1), 'stop': str(range_stop) } - output.append(r) + if not (ip_address(r['start']) > ip_address(r['stop'])): + output.append(r) else: # if we have no exclude in the whole range - we just take the range # as it is -- cgit v1.2.3