diff options
author | Steven Barth <steven@midlink.org> | 2013-12-15 19:10:20 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2013-12-15 19:10:20 +0000 |
commit | 306d96500aaf7a3a153f5b0629fa5d3cff268b33 (patch) | |
tree | b0885c8d1ac5c4c1e687baf2a17b1498ddc1933e /package/network/ipv6/odhcp6c | |
parent | c5340d1dbf7299bbfa2d53128aeeadfb95b40abc (diff) | |
download | upstream-306d96500aaf7a3a153f5b0629fa5d3cff268b33.tar.gz upstream-306d96500aaf7a3a153f5b0629fa5d3cff268b33.tar.bz2 upstream-306d96500aaf7a3a153f5b0629fa5d3cff268b33.zip |
odhcp6c: add source routing support
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39058 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/ipv6/odhcp6c')
-rw-r--r-- | package/network/ipv6/odhcp6c/Makefile | 4 | ||||
-rwxr-xr-x | package/network/ipv6/odhcp6c/files/dhcpv6.script | 10 | ||||
-rwxr-xr-x | package/network/ipv6/odhcp6c/files/dhcpv6.sh | 6 |
3 files changed, 15 insertions, 5 deletions
diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index bd794dc864..7d0c48d518 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcp6c -PKG_VERSION:=2013-10-29 +PKG_VERSION:=2013-12-15 PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=git://github.com/sbyx/odhcp6c.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=60c9e4d5a26f530e89ed6254e8c09380b50fac08 +PKG_SOURCE_VERSION:=be05c0ded0257cbb82857f6d01226ef6de28befe PKG_MAINTAINER:=Steven Barth <steven@midlink.org> include $(INCLUDE_DIR)/package.mk 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 \ |