git.99rst.org
/
openwrt-packages.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
3ad4820
)
isc-dhcp: refuse to add empty DHCP range
author
Leon M. Busch-George
<redacted>
Mon, 16 Oct 2023 03:35:14 +0000
(21:35 -0600)
committer
Philip Prindeville
<redacted>
Mon, 16 Oct 2023 03:35:14 +0000
(21:35 -0600)
ipcalc.sh no longer outputs invalid ranges and fails with an error code in
such cases. React to the error.
Signed-off-by: Leon M. Busch-George <redacted>
net/isc-dhcp/files/dhcpd.init
patch
|
blob
|
history
diff --git
a/net/isc-dhcp/files/dhcpd.init
b/net/isc-dhcp/files/dhcpd.init
index 0caffb8a81fa45ae343b963d6241a501841de6ec..111201009d033e3f88915b3cb37bc96bc1782162 100755
(executable)
--- a/
net/isc-dhcp/files/dhcpd.init
+++ b/
net/isc-dhcp/files/dhcpd.init
@@
-445,7
+445,10
@@
dhcpd_add() {
dhcp_ifs="$dhcp_ifs $ifname"
- ipcalc $subnet $start $limit
+ if ! ipcalc "$subnet" "$start" "$limit"; then
+ echo "invalid range params: $subnet start: $start limit $limit" >&2
+ return 1
+ fi
config_get netmask "$cfg" "netmask" "$NETMASK"
config_get leasetime "$cfg" "leasetime"
git clone https://git.99rst.org/PROJECT