aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-10-08 20:37:15 +0000
committerSteven Barth <steven@midlink.org>2014-10-08 20:37:15 +0000
commit6c80ad928899a8e2df77a66c9cba673b9c792c0f (patch)
tree0b700db5edb9685d3bbddda593b5406db34d5b52
parent495408914924fb185c49262f045aa91b7abd953d (diff)
downloadmaster-187ad058-6c80ad928899a8e2df77a66c9cba673b9c792c0f.tar.gz
master-187ad058-6c80ad928899a8e2df77a66c9cba673b9c792c0f.tar.bz2
master-187ad058-6c80ad928899a8e2df77a66c9cba673b9c792c0f.zip
ppp: allow auto-detecting and creation of ipv6 subinterface
this makes ipv6 with ppp a bit more comfortable Signed-off-by: Steven Barth <steven@midlink.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42854 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/network/services/ppp/Makefile2
-rwxr-xr-xpackage/network/services/ppp/files/lib/netifd/ppp-up9
-rwxr-xr-xpackage/network/services/ppp/files/ppp.sh6
3 files changed, 14 insertions, 3 deletions
diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile
index b320e304f2..a26850caf9 100644
--- a/package/network/services/ppp/Makefile
+++ b/package/network/services/ppp/Makefile
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ppp
PKG_VERSION:=2.4.7
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
diff --git a/package/network/services/ppp/files/lib/netifd/ppp-up b/package/network/services/ppp/files/lib/netifd/ppp-up
index fa14550ec4..286fc5f834 100755
--- a/package/network/services/ppp/files/lib/netifd/ppp-up
+++ b/package/network/services/ppp/files/lib/netifd/ppp-up
@@ -19,3 +19,12 @@ proto_send_update "$PPP_IPPARAM"
[ -x "$SCRIPT" ] && "$SCRIPT" "$@"
done
}
+
+if [ -n "$IPV6IFACE" -a "$(ifstatus $IPV6IFACE | jsonfilter -e @.device)" != "$IFNAME" ]; then
+ json_init
+ json_add_string name "${PPP_IPPARAM}_dhcpv6"
+ json_add_string ifname "@$PPP_IPPARAM"
+ json_add_string proto "dhcpv6"
+ json_close_object
+ ubus call network add_dynamic "$(json_dump)"
+fi
diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh
index f07b11f3fd..eb3f069d95 100755
--- a/package/network/services/ppp/files/ppp.sh
+++ b/package/network/services/ppp/files/ppp.sh
@@ -16,7 +16,7 @@ ppp_generic_init_config() {
proto_config_add_string pppd_options
proto_config_add_string 'connect:file'
proto_config_add_string 'disconnect:file'
- proto_config_add_boolean ipv6
+ proto_config_add_string ipv6
proto_config_add_boolean authfail
proto_config_add_int mtu
proto_config_add_string pppname
@@ -28,9 +28,11 @@ ppp_generic_setup() {
json_get_vars ipv6 demand keepalive username password pppd_options pppname
if [ "$ipv6" = 0 ]; then
ipv6=""
- else
+ elif [ -z "$ipv6" -o "$ipv6" = auto ]; then
ipv6=1
+ proto_export "IPV6IFACE=${config}6"
fi
+
if [ "${demand:-0}" -gt 0 ]; then
demand="precompiled-active-filter /etc/ppp/filter demand idle $demand"
else