summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Prindeville2023-11-05 19:23:29 +0000
committerKevin Darbyshire-Bryant2023-11-15 20:36:35 +0000
commitaf64898c2617babcf27ba2ae8c07dc801c208964 (patch)
tree8860c72ef4aedf5b720e9fe89f78a18aa509218e
parent6647e6d219d6ac460b04ff6b73931a4ae521df3c (diff)
dnsmasq: Invoke new ipcalc with CIDR notation
The new rewritten ipcalc.sh understands 3 notations: ipaddr/prefix ... ipaddr/dotted-netmask ... ipaddr dotted-netmask ... meaning that the previous 4th non-standard notation of "ipaddr prefix" will be dropped, alas that's the notation that dnsmasq currently uses. This change has us using the first notation which is the most common. This behavior came in as https://github.com/openwrt/openwrt/commit/eda27e8382f3e5253defab5419e95d4b51f72de3 a long time ago. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
-rw-r--r--package/network/services/dnsmasq/Makefile2
-rwxr-xr-xpackage/network/services/dnsmasq/files/dnsmasq.init9
2 files changed, 8 insertions, 3 deletions
diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index e442d0005b..241f3463e2 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmasq
PKG_UPSTREAM_VERSION:=2.89
PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION)))
-PKG_RELEASE:=6
+PKG_RELEASE:=7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz
PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index d356a21f81..0c76960236 100755
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -539,8 +539,13 @@ dhcp_add() {
# Do not support non-static interfaces for now
[ static = "$proto" ] || return 0
+ ipaddr="${subnet%%/*}"
+ prefix_or_netmask="${subnet##*/}"
+
# Override interface netmask with dhcp config if applicable
- config_get netmask "$cfg" netmask "${subnet##*/}"
+ config_get netmask "$cfg" netmask
+
+ [ -n "$netmask" ] && prefix_or_netmask="$netmask"
#check for an already active dhcp server on the interface, unless 'force' is set
config_get_bool force "$cfg" force 0
@@ -583,7 +588,7 @@ dhcp_add() {
nettag="${networkid:+set:${networkid},}"
# make sure the DHCP range is not empty
- if [ "$dhcpv4" != "disabled" ] && ipcalc "${subnet%%/*}" "$netmask" "$start" "$limit" ; then
+ if [ "$dhcpv4" != "disabled" ] && ipcalc "$ipaddr/$prefix_or_netmask" "$start" "$limit" ; then
[ "$dynamicdhcpv4" = "0" ] && END="static"
xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}"