[OpenWrt-Devel] [PATCH 1/6] ppp: cleanup fetching values for several parameters

Yousong Zhou yszhou4tech at gmail.com
Tue Sep 1 08:31:34 EDT 2015


On 1 September 2015 at 20:22, Felix Fietkau <nbd at openwrt.org> wrote:
> On 2015-09-01 14:14, Yousong Zhou wrote:
>> Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
>> ---
>>  package/network/services/ppp/files/ppp.sh |    4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh
>> index a6389a8..b970f29 100755
>> --- a/package/network/services/ppp/files/ppp.sh
>> +++ b/package/network/services/ppp/files/ppp.sh
>> @@ -86,6 +86,7 @@ ppp_generic_setup() {
>>       local localip
>>
>>       json_get_vars ipv6 demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered
>> +     json_get_vars connect disconnect mtu
>>       if [ "$ipv6" = 0 ]; then
>>               ipv6=""
>>       elif [ -z "$ipv6" -o "$ipv6" = auto ]; then
>> @@ -98,7 +99,6 @@ ppp_generic_setup() {
>>       else
>>               demand=""
>>       fi
>> -     [ -n "$mtu" ] || json_get_var mtu mtu
>>       [ -n "$pppname" ] || pppname="${proto:-ppp}-$config"
>>       [ -n "$unnumbered" ] && {
>>               local subnets
>> @@ -117,8 +117,6 @@ ppp_generic_setup() {
>>       [ "${lcp_failure:-0}" -lt 1 ] && lcp_failure=""
>>       [ "$lcp_interval" != "$keepalive" ] || lcp_interval=5
>>       [ "${keepalive_adaptive:-1}" -lt 1 ] && lcp_adaptive=""
>> -     [ -n "$connect" ] || json_get_var connect connect
>> -     [ -n "$disconnect" ] || json_get_var disconnect disconnect
> The point of that code was to allow callers of that function to override
> these values. Did you check all callers?
>

Wow, just found out that comgt 3g.sh is utilising this construct.
Sorry, never thought of such a usage.

Cheers.

               yousong
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list