aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-05-24 13:03:26 +0000
committerSteven Barth <steven@midlink.org>2013-05-24 13:03:26 +0000
commitad8fbaf8a564f439508f00c6fd9097cc329834d0 (patch)
tree873ef74a5bc02e3e6be5b6128a3ecc12b982631f
parent1560a35e901283ecec12496edcdbff7ea2805c1d (diff)
downloadupstream-ad8fbaf8a564f439508f00c6fd9097cc329834d0.tar.gz
upstream-ad8fbaf8a564f439508f00c6fd9097cc329834d0.tar.bz2
upstream-ad8fbaf8a564f439508f00c6fd9097cc329834d0.zip
AA: backport netifd from trunk
git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@36705 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/netifd/Makefile4
-rwxr-xr-xpackage/netifd/files/lib/netifd/dhcp.script24
-rwxr-xr-xpackage/netifd/files/lib/netifd/proto/dhcp.sh6
3 files changed, 30 insertions, 4 deletions
diff --git a/package/netifd/Makefile b/package/netifd/Makefile
index b5dd767f7e..e074ab5dec 100644
--- a/package/netifd/Makefile
+++ b/package/netifd/Makefile
@@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netifd
-PKG_VERSION:=2013-01-29.2
+PKG_VERSION:=2013-05-17
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git://nbd.name/luci2/netifd.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=4bb99d4eb462776336928392010b372236ac3c93
+PKG_SOURCE_VERSION:=2f31bff38d4dc2f36006ded6b8a7d039cb569eaa
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
# PKG_MIRROR_MD5SUM:=
diff --git a/package/netifd/files/lib/netifd/dhcp.script b/package/netifd/files/lib/netifd/dhcp.script
index d26db0f4d1..b365a53528 100755
--- a/package/netifd/files/lib/netifd/dhcp.script
+++ b/package/netifd/files/lib/netifd/dhcp.script
@@ -35,6 +35,30 @@ setup_interface () {
done
proto_send_update "$INTERFACE"
+ if [ -n "$IFACE6RD" -a -n "$ip6rd" ]; then
+ local v4mask="${ip6rd%% *}"
+ ip6rd="${ip6rd#* }"
+ local ip6rdprefixlen="${ip6rd%% *}"
+ ip6rd="${ip6rd#* }"
+ local ip6rdprefix="${ip6rd%% *}"
+ ip6rd="${ip6rd#* }"
+ local ip6rdbr="${ip6rd%% *}"
+
+uci -q batch <<-EOF >/dev/null
+set network.$IFACE6RD.proto=6rd
+set network.$IFACE6RD.auto=0
+set network.$IFACE6RD.peeraddr=$ip6rdbr
+set network.$IFACE6RD.ip4prefixlen=$v4mask
+set network.$IFACE6RD.ip6prefix=$ip6rdprefix
+set network.$IFCAE6RD.ip6prefixlen=$ip6rdprefixlen
+commit network
+EOF
+
+ ifdown "$IFACE6RD"
+ /etc/init.d/network reload
+ ifup "$IFACE6RD"
+ fi
+
# TODO
# [ -n "$ntpsrv" ] && change_state network "$ifc" lease_ntpsrv "$ntpsrv"
# [ -n "$timesvr" ] && change_state network "$ifc" lease_timesrv "$timesvr"
diff --git a/package/netifd/files/lib/netifd/proto/dhcp.sh b/package/netifd/files/lib/netifd/proto/dhcp.sh
index 38308785df..a270c681d7 100755
--- a/package/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/netifd/files/lib/netifd/proto/dhcp.sh
@@ -12,14 +12,15 @@ proto_dhcp_init_config() {
proto_config_add_string "vendorid"
proto_config_add_boolean "broadcast"
proto_config_add_string "reqopts"
+ proto_config_add_string "iface6rd"
}
proto_dhcp_setup() {
local config="$1"
local iface="$2"
- local ipaddr hostname clientid vendorid broadcast reqopts
- json_get_vars ipaddr hostname clientid vendorid broadcast reqopts
+ local ipaddr hostname clientid vendorid broadcast reqopts iface6rd
+ json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd
local opt dhcpopts
for opt in $reqopts; do
@@ -28,6 +29,7 @@ proto_dhcp_setup() {
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
+ [ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
proto_export "INTERFACE=$config"
proto_run_command "$config" udhcpc \