summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2012-12-22 13:00:53 +0000
committerSteven Barth <cyrus@openwrt.org>2012-12-22 13:00:53 +0000
commita4e656ef240a1367dbb8728aa34868cfbb272932 (patch)
tree3a39e50b7007aa084f76e279a50cd386d9f5254a
parent2dbfffef68bf60b4c99f9bddab3f821e5690afa0 (diff)
downloadmtk-20170518-a4e656ef240a1367dbb8728aa34868cfbb272932.zip
mtk-20170518-a4e656ef240a1367dbb8728aa34868cfbb272932.tar.gz
mtk-20170518-a4e656ef240a1367dbb8728aa34868cfbb272932.tar.bz2
ipv6-support: Preliminary support for dnsmasq >=2.66
SVN-Revision: 34858
-rw-r--r--package/network/ipv6/ipv6-support/Makefile2
-rw-r--r--package/network/ipv6/ipv6-support/files/support.sh32
2 files changed, 29 insertions, 5 deletions
diff --git a/package/network/ipv6/ipv6-support/Makefile b/package/network/ipv6/ipv6-support/Makefile
index d570e54..6bc3f79 100644
--- a/package/network/ipv6/ipv6-support/Makefile
+++ b/package/network/ipv6/ipv6-support/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ipv6-support
-PKG_VERSION:=2012-12-11
+PKG_VERSION:=2012-12-22
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
diff --git a/package/network/ipv6/ipv6-support/files/support.sh b/package/network/ipv6/ipv6-support/files/support.sh
index f723e6e..8cd044f 100644
--- a/package/network/ipv6/ipv6-support/files/support.sh
+++ b/package/network/ipv6/ipv6-support/files/support.sh
@@ -172,8 +172,17 @@ disable_router() {
# Notify the address distribution daemon
ubus call 6distributed deliface '{"network": "'"$network"'"}'
- # Disable advertisement daemon
- stop_service /usr/sbin/6relayd "/var/run/ipv6-router-$network.pid"
+
+ # Start RD & DHCPv6 service
+ local router_service
+ config_get router_service global router_service
+
+ if [ "$router_service" == "dnsmasq" ]; then
+ rm -f "/var/etc/dnsmasq.d/ipv6-router-$network.conf"
+ /etc/init.d/dnsmasq restart
+ else
+ stop_service /usr/sbin/6relayd "/var/run/ipv6-router-$network.pid"
+ fi
}
@@ -424,8 +433,23 @@ enable_router() {
[ "$length" -ne "0" ] && ubus call 6distributed newiface '{"network": "'"$network"'", "iface": "'"$device"'", "length": '"$length"'}'
# Start RD & DHCPv6 service
- local pid="/var/run/ipv6-router-$network.pid"
- start_service "/usr/sbin/6relayd -S . $device" "$pid"
+ local router_service
+ config_get router_service global router_service
+
+ if [ "$router_service" == "dnsmasq" ]; then
+ local dnsmasq_opts
+ config_get dnsmasq_opts global dnsmasq_opts
+ [ -z "$dnsmasq_opts" ] && dnsmasq_opts="ra-stateful,ra-names"
+
+ local conf="/var/etc/dnsmasq.d/ipv6-router-$network.conf"
+ mkdir -p $(dirname $conf)
+ echo "dhcp-range=::1,constructor:$device,$dnsmasq_opts" > $conf
+ echo "enable-ra" >> $conf
+ /etc/init.d/dnsmasq restart
+ else
+ local pid="/var/run/ipv6-router-$network.pid"
+ start_service "/usr/sbin/6relayd -S . $device" "$pid"
+ fi
# Try relaying if necessary
restart_master_relay "$network"