From patchwork Fri Jun 14 11:09:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Valentin?= X-Patchwork-Id: 1115917 X-Patchwork-Delegate: dedeckeh@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=marcant.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QVbIRjRI"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45QHw84ySsz9s4Y for ; Fri, 14 Jun 2019 21:10:48 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HayNPJabpE50l9QMMzu6OouvKZLio3hJ+Gb7HIk67P0=; b=QVbIRjRIoSSK6t /rbhqwB/Amby3CtdyQ9YFFsRQtiZvWBkksF2If9F9smJiqC0EPt9iZFqwepLwACqtXQafIJLfaIaN Y5W7rmCO/bSoeIFunZb/hxxEpjGwD1AKUCXJRBr/4SP3SxDXRTMiQaoWaFYvh6cixDBMKfnayxELr 3kw/pTo8zTx8PoS5hr1oa9ORsg4glgxBS79DEFiIpcmZTswPjfIoPpXGs3f0xlrDc/Wzw+gbkdePs c7soxtLI4J1fWVHpkQ4tkVwokD9M2mKJ1l0al/YVCRxZ5VaWzuN3unNu27A/tc0rAmDPbC31yxqCH 0uKQupjZqV3m0LLTFDag==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbk6K-00089P-Ca; Fri, 14 Jun 2019 11:10:32 +0000 Received: from mail3.marcant.net ([217.14.160.188]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hbk5w-0006XB-2L for openwrt-devel@lists.openwrt.org; Fri, 14 Jun 2019 11:10:11 +0000 Received: from [192.168.180.1] (port=48390 helo=admins.marcant.net) by mail3.marcant.net with esmtp (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1hbk5g-0003tl-2O for openwrt-devel@lists.openwrt.org; Fri, 14 Jun 2019 13:09:52 +0200 Received: from varus.marcant.loc (unknown [192.168.3.44]) by admins.marcant.net (Postfix) with ESMTPA id A296F2803A0; Fri, 14 Jun 2019 13:09:52 +0200 (CEST) From: =?utf-8?q?Andr=C3=A9_Valentin?= To: openwrt-devel@lists.openwrt.org Date: Fri, 14 Jun 2019 13:09:47 +0200 Message-Id: <20190614110947.10540-4-avalentin@marcant.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190614110947.10540-1-avalentin@marcant.net> References: <20190614110947.10540-1-avalentin@marcant.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190614_041008_295006_BAEBF887 X-CRM114-Status: UNSURE ( 8.20 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [217.14.160.188 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH 2/3] network/config/xfrm: add host-dependency for xfrm interface parent X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Andr=C3=A9_Valentin?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add proto_add_host_dependency to add a dependency to the tunlink interface Signed-off-by: André Valentin --- package/network/config/xfrm/files/xfrm.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/package/network/config/xfrm/files/xfrm.sh b/package/network/config/xfrm/files/xfrm.sh index df28d38613..4711bf2f55 100755 --- a/package/network/config/xfrm/files/xfrm.sh +++ b/package/network/config/xfrm/files/xfrm.sh @@ -14,24 +14,27 @@ proto_xfrm_setup() { local tunlink ifid mtu zone json_get_vars tunlink ifid mtu zone - proto_init_update "$cfg" 1 - - proto_add_tunnel - json_add_string mode "$mode" - json_add_int mtu "${mtu:-1280}" - [ -z "$tunlink" ] && { proto_notify_error "$cfg" NO_TUNLINK proto_block_restart "$cfg" exit } - json_add_string link "$tunlink" - [ -z "$ifid" ] && { proto_notify_error "$cfg" NO_IFID proto_block_restart "$cfg" exit } + + ( proto_add_host_dependency "$cfg" '' "$tunlink" ) + + proto_init_update "$cfg" 1 + + proto_add_tunnel + json_add_string mode "$mode" + json_add_int mtu "${mtu:-1280}" + + json_add_string link "$tunlink" + json_add_object 'data' [ -n "$ifid" ] && json_add_int ifid "$ifid" json_close_object