summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-01-03 09:18:31 +0100
committerChristian Poessinger <christian@poessinger.com>2021-01-03 09:18:31 +0100
commitcb16068ccde3b39f2e0e2aa450da7df55f782c1c (patch)
tree399c7b502d6558000175ec8e950918cb55dd1d0e /src/conf_mode
parenta35d412b4be39a84a1e9dfaabaa94eddc9bd8d2c (diff)
downloadvyos-1x-cb16068ccde3b39f2e0e2aa450da7df55f782c1c.tar.gz
vyos-1x-cb16068ccde3b39f2e0e2aa450da7df55f782c1c.zip
dhcp: T3180: bugfix NameError when slicing server ranges
Introduced in commit e46def834483e ("dhcp: T3100: re-add range slicing support when exclude addresses are used") by not obeying the move from list to dict and still relying on the old list names variables.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/dhcp_server.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/conf_mode/dhcp_server.py b/src/conf_mode/dhcp_server.py
index 1ab2d8d16..fee2afe24 100755
--- a/src/conf_mode/dhcp_server.py
+++ b/src/conf_mode/dhcp_server.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2018-2020 VyOS maintainers and contributors
+# Copyright (C) 2018-2021 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -89,11 +89,11 @@ def dhcp_slice_range(exclude_list, range_dict):
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
+ # if the excluded address was not part of the range, we simply return
+ # the entire ranga again
if not range_last_exclude:
- if ra not in output:
- output.append(ra)
+ if range_dict not in output:
+ output.append(range_dict)
return output