From patchwork Tue Sep 1 12:14:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 512796 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6D66B14056B for ; Tue, 1 Sep 2015 22:18:50 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=AQM82b+Z; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 3955128C005; Tue, 1 Sep 2015 14:17:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 5532828BFDC for ; Tue, 1 Sep 2015 14:17:32 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 1 Sep 2015 14:17:32 +0200 (CEST) Received: by pader10 with SMTP id er10so5159711pad.3 for ; Tue, 01 Sep 2015 05:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=rduhb+la+fYD56zSCnYaOnACI3MxWkQGruW5EQpBi8E=; b=AQM82b+ZgpmWDcfJrqvfE6NnuNVPWWuZduo3Ekxo+AzcNozIXB4HGXYibWkY0neRBG LVm4c2GMDwq9fPMyVhQRur5tnetsFe3jP2H0aEpCpQLjAFeco8+19zpigh1TrY+UacY/ ZhoYnNfTCbv2ALZ34lWyqdlN2l5+b8DY8hp6TGYGEnjvezsgNdubwy7oLiMaLXHbRmmE mvXUxIpdeBGKXLvwa16ZZIN5y9zkopb0T4Ki9qFUzB56NHvOiGBoMi3UDn1bqOq0dPxK kWxUNdbiIyT9A8NWNgmEuxywmfLnIfMI3w8qk7ejp+Ln5oD/q6CMFrH2/1v0ZtIMtuZ7 C+0g== X-Received: by 10.68.226.134 with SMTP id rs6mr46103593pbc.11.1441109908225; Tue, 01 Sep 2015 05:18:28 -0700 (PDT) Received: from debian.corp.sankuai.com ([103.29.140.57]) by smtp.gmail.com with ESMTPSA id qc2sm17967378pbc.79.2015.09.01.05.18.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Sep 2015 05:18:27 -0700 (PDT) From: Yousong Zhou To: openwrt-devel@lists.openwrt.org Date: Tue, 1 Sep 2015 20:14:41 +0800 Message-Id: <1441109686-27796-1-git-send-email-yszhou4tech@gmail.com> X-Mailer: git-send-email 1.7.10.4 Subject: [OpenWrt-Devel] [PATCH 1/6] ppp: cleanup fetching values for several parameters X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Yousong Zhou --- 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 proto_run_command "$config" /usr/sbin/pppd \ nodetach ipparam "$config" \