summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-10-19 10:11:46 +0200
committerChristian Poessinger <christian@poessinger.com>2019-10-19 10:14:20 +0200
commit1887d3a78ce9e6b040eb3ac1300069aca38ca0f6 (patch)
treec817ac97139ad23ee7efbc38b0d7b56311e0761c /src/conf_mode
parentdbdd87717ad807e107f0aa174c79b4f82a6c13ab (diff)
downloadvyos-1x-1887d3a78ce9e6b040eb3ac1300069aca38ca0f6.tar.gz
vyos-1x-1887d3a78ce9e6b040eb3ac1300069aca38ca0f6.zip
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)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/dhcp_server.py3
1 files changed, 2 insertions, 1 deletions
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