diff options
author | Ian Dall <ian@beware.dropbear.id.au> | 2023-03-10 17:02:34 +1030 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2023-04-01 22:35:13 +0200 |
commit | ed86454578efa1ae9e0ea522c8612e2b7c36b6dd (patch) | |
tree | 625a36fce305024393aadaa042eea861d7369804 /package/network/services | |
parent | cbf120c25541f180a79c28180be23286cabc78f8 (diff) | |
download | upstream-ed86454578efa1ae9e0ea522c8612e2b7c36b6dd.tar.gz upstream-ed86454578efa1ae9e0ea522c8612e2b7c36b6dd.tar.bz2 upstream-ed86454578efa1ae9e0ea522c8612e2b7c36b6dd.zip |
dnsmasq: configure dynamic dhcp6 and dhcp4 independently
Given ipv6 has SLAAC it is quite plausible to wish to use dynamic
dhcp4 but static dhcp6. This patch keeps dynamicdhcp as the default
option for both, but is overridden by dynamicdhcpv6 or dynamicdhcpv4
Signed-off-by: Ian Dall <ian@beware.dropbear.id.au>
Diffstat (limited to 'package/network/services')
-rwxr-xr-x | package/network/services/dnsmasq/files/dnsmasq.init | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 608ef013f1..2a3327b0c6 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -557,6 +557,8 @@ dhcp_add() { config_get leasetime "$cfg" leasetime 12h config_get options "$cfg" options config_get_bool dynamicdhcp "$cfg" dynamicdhcp 1 + config_get_bool dynamicdhcpv4 "$cfg" dynamicdhcpv4 $dynamicdhcp + config_get_bool dynamicdhcpv6 "$cfg" dynamicdhcpv6 $dynamicdhcp config_get dhcpv4 "$cfg" dhcpv4 config_get dhcpv6 "$cfg" dhcpv6 @@ -586,12 +588,12 @@ dhcp_add() { # make sure the DHCP range is not empty if [ "$dhcpv4" != "disabled" ] && eval "$(ipcalc.sh "${subnet%%/*}" "$netmask" "$start" "$limit")" ; then - [ "$dynamicdhcp" = "0" ] && END="static" + [ "$dynamicdhcpv4" = "0" ] && END="static" xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}" fi - if [ "$dynamicdhcp" = "0" ] ; then + if [ "$dynamicdhcpv6" = "0" ] ; then dhcp6range="::,static" else dhcp6range="::1000,::ffff" |