Index: package/base-files/files/sbin/ifdown =================================================================== --- package/base-files/files/sbin/ifdown (revision 6945) +++ package/base-files/files/sbin/ifdown (working copy) @@ -60,3 +60,9 @@ config_get iftype "$cfg" type [ "$iftype" = "bridge" ] && brctl delbr "$ifname" >/dev/null 2>/dev/null +[ "$cfg" = "wan" -a "$proto" = "pppoe" -a "${device%%[0-9]*}" = "nas" ] && { + sleep 2 + kill `head -n1 /var/run/${device}.pid 2> /dev/null` 2> /dev/null + sleep 2 + rm -f /var/run/${device}.pid +} Index: package/ppp/files/pppoa.sh =================================================================== --- package/ppp/files/pppoa.sh (revision 6945) +++ package/ppp/files/pppoa.sh (working copy) @@ -13,10 +13,17 @@ for module in slhc ppp_generic pppoatm; do /sbin/insmod $module 2>&- >&- done + + config_get encaps "$config" encaps + case "$encaps" in + 0|vc) ENCAPS="vc-encaps" ;; + 1|llc) ENCAPS="llc-encaps" ;; + *) ENCAPS="vc-encaps" ;; + esac config_get mtu "$cfg" mtu mtu=${mtu:-1500} start_pppd "$config" \ - plugin pppoatm.so ${vpi:-8}.${vci:-35} \ + plugin pppoatm.so ${vpi:-8}.${vci:-35} ${ENCAPS} \ mtu $mtu mru $mtu } Index: package/ppp/files/pppoe.sh =================================================================== --- package/ppp/files/pppoe.sh (revision 6945) +++ package/ppp/files/pppoe.sh (working copy) @@ -11,6 +11,20 @@ for module in slhc ppp_generic pppox pppoe; do /sbin/insmod $module 2>&- >&- done + + if [ "${device%%[0-9]*}" = "nas" ] + then + config_get vpi "$config" vpi + config_get vci "$config" vci + config_get encaps "$config" encaps + case "$encaps" in + 0|vc) ENCAPS=0 ;; + 1|llc) ENCAPS=1 ;; + *) ENCAPS=0 ;; + esac + nas_num=${dev#nas} + ifconfig ${device} > /dev/null || br2684ctl -b -c ${nas_num} -e ${ENCAPS} -a ${vpi:-8}.${vci:-35} + fi config_get mtu "$cfg" mtu mtu=${mtu:-1492}