diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-11-07 13:24:10 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-11-07 13:24:10 +0000 |
commit | d62770f5492028d5543ac4fe2165d68dfbb31b63 (patch) | |
tree | 6320ee8078f39d7288235f284c1ce714dd5b1443 /package/ppp/files | |
parent | 7c6c1d877efe5e06b2da94c85aab111ce6824c4e (diff) |
add ppp ipv6 patch by farnz (from #2525)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9508 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/ppp/files')
-rw-r--r-- | package/ppp/files/etc/ppp/ipv6-down | 16 | ||||
-rw-r--r-- | package/ppp/files/etc/ppp/ipv6-up | 16 | ||||
-rw-r--r-- | package/ppp/files/ppp.sh | 5 |
3 files changed, 35 insertions, 2 deletions
diff --git a/package/ppp/files/etc/ppp/ipv6-down b/package/ppp/files/etc/ppp/ipv6-down index 76678de72..a4e0491a8 100644 --- a/package/ppp/files/etc/ppp/ipv6-down +++ b/package/ppp/files/etc/ppp/ipv6-down @@ -1,2 +1,16 @@ #!/bin/sh -route -A inet6 del $4 dev $1 + +gw=$4 +dev=$1 +cfg=$6 + +. /etc/functions.sh # common functions +include /lib/network # include /lib/network/*.sh +scan_interfaces # read and parse the network config + +config_get_bool defaultroute "$cfg" defaultroute 1 + +if [ ${defaultroute} -eq 1 ] +then + route -A inet6 del default gw ${gw} dev ${dev} +fi diff --git a/package/ppp/files/etc/ppp/ipv6-up b/package/ppp/files/etc/ppp/ipv6-up index e34947152..9ece44ad8 100644 --- a/package/ppp/files/etc/ppp/ipv6-up +++ b/package/ppp/files/etc/ppp/ipv6-up @@ -1,2 +1,16 @@ #!/bin/sh -route -A inet6 add default $4 dev $1 + +gw=$4 +dev=$1 +cfg=$6 + +. /etc/functions.sh # common functions +include /lib/network # include /lib/network/*.sh +scan_interfaces # read and parse the network config + +config_get_bool defaultroute "$cfg" defaultroute 1 + +if [ ${defaultroute} -eq 1 ] +then + route -A inet6 add default gw ${gw} dev ${dev} +fi diff --git a/package/ppp/files/ppp.sh b/package/ppp/files/ppp.sh index 5ca1cf9c7..339b4e73e 100644 --- a/package/ppp/files/ppp.sh +++ b/package/ppp/files/ppp.sh @@ -37,6 +37,10 @@ start_pppd() { config_get demand "$cfg" demand [ -n "$demand" ] && echo "nameserver 1.1.1.1" > /tmp/resolv.conf.auto + + config_get_bool ipv6 "$cfg" ipv6 0 + [ "$ipv6" -eq 1 ] && ipv6="+ipv6" || ipv6="" + /usr/sbin/pppd "$@" \ ${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}} \ ${demand:+precompiled-active-filter /etc/ppp/filter demand idle }${demand:-persist} \ @@ -48,6 +52,7 @@ start_pppd() { ipparam "$cfg" \ ${connect:+connect "$connect"} \ ${disconnect:+disconnect "$disconnect"} \ + ${ipv6} \ ${pppd_options} lock -u "/var/lock/ppp-${cfg}" |