aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/ipv6/odhcp6c/files
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2013-12-15 19:10:20 +0000
committerSteven Barth <cyrus@openwrt.org>2013-12-15 19:10:20 +0000
commitfd50416248add8012b0581fc3c28875c546c947b (patch)
treecbc14d2fcd129c7e8603e951e4515f6cdaae0924 /package/network/ipv6/odhcp6c/files
parente444eb0bbd90c67b787c0e9b7875d241a4de939a (diff)
downloadupstream-fd50416248add8012b0581fc3c28875c546c947b.tar.gz
upstream-fd50416248add8012b0581fc3c28875c546c947b.tar.bz2
upstream-fd50416248add8012b0581fc3c28875c546c947b.zip
odhcp6c: add source routing support
SVN-Revision: 39058
Diffstat (limited to 'package/network/ipv6/odhcp6c/files')
-rwxr-xr-xpackage/network/ipv6/odhcp6c/files/dhcpv6.script10
-rwxr-xr-xpackage/network/ipv6/odhcp6c/files/dhcpv6.sh6
2 files changed, 13 insertions, 3 deletions
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script
index 324a823ce9..1d5f521e45 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script
@@ -64,7 +64,15 @@ setup_interface () {
entry="${entry#*,}"
local metric="${entry%%,*}"
- proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid"
+ if [ -z "$SOURCE_ROUTING" -o -z "$gw" ]; then
+ proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid"
+ else
+ proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "::/128"
+ for prefix in $PREFIXES; do
+ local paddr="${prefix%%,*}"
+ proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "$paddr"
+ done
+ fi
done
proto_send_update "$INTERFACE"
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
index ab344e1d30..0638d28f5f 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
@@ -15,14 +15,15 @@ proto_dhcpv6_init_config() {
proto_config_add_string "ip6prefix"
proto_config_add_string "iface_dslite"
proto_config_add_string "ifaceid"
+ proto_config_add_string "sourcerouting"
}
proto_dhcpv6_setup() {
local config="$1"
local iface="$2"
- local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite ifaceid
- json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite ifaceid
+ local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite ifaceid sourcerouting
+ json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite ifaceid sourcerouting
# Configure
@@ -48,6 +49,7 @@ proto_dhcpv6_setup() {
[ -n "$ip6prefix" ] && proto_export "USERPREFIX=$ip6prefix"
[ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite"
+ [ "$sourcerouting" = "1" ] && proto_export "SOURCE_ROUTING=1"
proto_export "INTERFACE=$config"
proto_run_command "$config" odhcp6c \