From patchwork Mon Apr 30 08:28:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Fabian X-Patchwork-Id: 906531 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bosson.cz Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bosson.cz header.i=@bosson.cz header.b="WZKKwBJ9"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40ZHjz158pz9rxs for ; Mon, 30 Apr 2018 18:28:23 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752566AbeD3I2W (ORCPT ); Mon, 30 Apr 2018 04:28:22 -0400 Received: from mailalternative.uvtmail.cz ([109.205.75.52]:56982 "EHLO mail.hosting.cldn.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751794AbeD3I2T (ORCPT ); Mon, 30 Apr 2018 04:28:19 -0400 Received: from voxel.localnet (linux.uvt.cz [178.17.1.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: fabian@bosson.cz) by mail.hosting.cldn.cz (Postfix) with ESMTPSA id AD87F268F5 for ; Mon, 30 Apr 2018 10:28:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bosson.cz; s=mail; t=1525076897; bh=eA2//kQoN2FtaumYc94EPbJFrXNUQvXH22C2HxWvfLs=; h=From:To:Subject:Date; b=WZKKwBJ9V7X+NC0sgI+43iNKZQQgJvjGPIR7a0xv0//jDvlvZWk/252y3PwbY/lrv 28CjXfuXS8VUfKMUVxzzfUtJVlTrXDW+KwiSI0WA1yjxEUXcoSxyvwLQCcG/LrvJAB Hd6mkJ+VaTrSHpI/QbnfO0b2gOFfSD1X/JjFhzO5VzJNWNekTsa/bHnvU1QbGhSYKC Qk/7nbPoZUWPlkXzVZWmq88/OA50cgQb3BkQqcPQS/0kWwwaOmuiu7d0OKKdiOVcfS DyGNSkqjBy/Aylrol1zMvXxIjOFB5ZORMGEZt7NPXw17fRGlVQ1j1GqOLrKrO8Tpko BzlibX7jS+bjw== From: David Fabian To: netfilter-devel@vger.kernel.org Subject: nftables: added support for per-file variable scopes and global variables Date: Mon, 30 Apr 2018 10:28:16 +0200 Message-ID: <1825461.eMsbQJIbDQ@voxel> Organization: =?utf-8?b?w5pWVCw=?= s.r.o. MIME-Version: 1.0 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Hello, this series of patches follows a discussion brought here about adding support for deeper variable scopes especially in the flat notation. These patches add a new variable scope to each include statement. The new scope is a child of the parent scope (script in which the include resides). All variables in the parent are still accessible in the child but the parent cannot access child variables. This effectively creates a tree hierarchy and with the support of redefine, one can even mask inherited variables in the child scopes. Sibling scopes are not accessible from each other. If one wants to have some global definitions in a separate script and not pollute the top-level script, one can use a new keyword global in the define like: define global global_var=eth0 This puts $global_var to the top-level scope which is accessible from everywhere and it survives any include. Global re-definitions and undefines are also supported. From 12bdc9e48ddfc9fc539713f4dfb0204aaf3bbdfe Mon Sep 17 00:00:00 2001 From: David Fabian Date: Mon, 30 Apr 2018 09:21:44 +0200 Subject: [PATCH 7/7] Call proper nft binary in run-tests.sh --- tests/shell/run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh index b52611b..6a0830f 100755 --- a/tests/shell/run-tests.sh +++ b/tests/shell/run-tests.sh @@ -123,7 +123,7 @@ do if [ "$DUMPGEN" == "y" ] && [ "$rc_got" == "${POSITIVE_RET}" ] && [ ! -f "${dumpfile}" ]; then mkdir -p "${dumppath}" - nft list ruleset > "${dumpfile}" + $NFT list ruleset > "${dumpfile}" fi else ((failed++)) -- 2.13.6