aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/config/netifd/files
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2014-07-24 14:17:41 +0000
committerSteven Barth <cyrus@openwrt.org>2014-07-24 14:17:41 +0000
commit9231df566517da7cc679b5a09832e9eb84d31ef3 (patch)
tree7fa2a14ad9ce97542dd981e945753458746f51c0 /package/network/config/netifd/files
parenta8486aeff346df74a19b8e73f137d0b3c985dd89 (diff)
downloadupstream-9231df566517da7cc679b5a09832e9eb84d31ef3.tar.gz
upstream-9231df566517da7cc679b5a09832e9eb84d31ef3.tar.bz2
upstream-9231df566517da7cc679b5a09832e9eb84d31ef3.zip
softwires: redesign dhcp(v6) provisioning
Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 41823
Diffstat (limited to 'package/network/config/netifd/files')
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/dhcp.script12
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/proto/dhcp.sh6
2 files changed, 15 insertions, 3 deletions
diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script
index 948c3cd665..db3fc011a1 100755
--- a/package/network/config/netifd/files/lib/netifd/dhcp.script
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
@@ -33,9 +33,15 @@ setup_interface () {
for domain in $domain; do
proto_add_dns_search "$domain"
done
+
+ proto_add_data
+ [ -n "$ZONE" ] && json_add_string zone "$ZONE"
+ proto_close_data
+
proto_send_update "$INTERFACE"
- if [ -n "$IFACE6RD" -a -n "$ip6rd" ]; then
+
+ if [ "$IFACE6RD" != 0 -a -n "$ip6rd" ]; then
local v4mask="${ip6rd%% *}"
ip6rd="${ip6rd#* }"
local ip6rdprefixlen="${ip6rd%% *}"
@@ -44,6 +50,9 @@ setup_interface () {
ip6rd="${ip6rd#* }"
local ip6rdbr="${ip6rd%% *}"
+ [ -n "$ZONE" ] || ZONE=$(fw3 network $INTERFACE)
+ [ -z "$IFACE6RD" -o "$IFACE6RD" = 1 ] && IFACE6RD=${INTERFACE}_6rd
+
json_init
json_add_string name "$IFACE6RD"
json_add_string ifname "@$INTERFACE"
@@ -54,6 +63,7 @@ setup_interface () {
json_add_int ip6prefixlen "$ip6rdprefixlen"
json_add_string tunlink "$INTERFACE"
[ -n "$IFACE6RD_DELEGATE" ] && json_add_boolean delegate "$IFACE6RD_DELEGATE"
+ [ -n "$ZONE6RD" ] || ZONE6RD=$ZONE
[ -n "$ZONE6RD" ] && json_add_string zone "$ZONE6RD"
json_close_object
diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index 178ff551b5..b14f7be92d 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -17,14 +17,15 @@ proto_dhcp_init_config() {
proto_config_add_string sendopts
proto_config_add_boolean delegate
proto_config_add_string zone6rd
+ proto_config_add_string zone
}
proto_dhcp_setup() {
local config="$1"
local iface="$2"
- local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd
- json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd
+ local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone
+ json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone
local opt dhcpopts
for opt in $reqopts; do
@@ -40,6 +41,7 @@ proto_dhcp_setup() {
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
[ -n "$iface6rd" ] && append dhcpopts "-O 212"
[ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
+ [ -n "$zone" ] && proto_export "ZONE=$zone"
[ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
proto_export "INTERFACE=$config"