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"
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
[ "$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 \