From patchwork Tue Jan 9 18:59:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harsha Sharma X-Patchwork-Id: 857681 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="moYWup06"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zGLzc3c4Gz9s4q for ; Wed, 10 Jan 2018 05:59:40 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935081AbeAIS7i (ORCPT ); Tue, 9 Jan 2018 13:59:38 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:42318 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932310AbeAIS7g (ORCPT ); Tue, 9 Jan 2018 13:59:36 -0500 Received: by mail-pg0-f66.google.com with SMTP id q67so8598232pga.9 for ; Tue, 09 Jan 2018 10:59:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=I6kVR/dF9dfW+u5+VciLuIJnt2pLRarkLkQgzxOmULg=; b=moYWup06twKNCnA2iMp/I5U01AV8PHrNK8SXNZF/PvLSEAHQTi0ua7dn+jhrGI43j2 /xCdNXQyIu8n8nqjbBFVaXpmVxRrQv+HgzkZD3NtqB6piqHvoTF9lKbCvhdRjdyBfyt+ FB2thkhwmERhg3hOZ6xARZT5GqPtHff3/QPbpPAAhQ2BvY6ZSUk/cM+KRzQOJ3qPsfVK U2Fs1smh43Mmo6DlAvpxFCuKfnxI6eVd1zKLzlSu4ZPIxE7GHgg9Q5N2DmqDzCKm2c36 23dyXEV2tBsJjlBxKzlRBAJD5hTlcQoIl/Tezz2rOQSi0Y+x794g3Q9TVlHfbxU7pDZj 8gKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=I6kVR/dF9dfW+u5+VciLuIJnt2pLRarkLkQgzxOmULg=; b=B5oEgomnsnA/gdlhC/vWXWjQOWo0PrTqmcajrl3LgVgcIVXDikQr9+BzFwyN9ndKqC /3SJg84T1fVN4hsOPqMmFbN9JeKxv89f+XpJJrcw6RwhtSBp3oUj2dDOfyT0gTxahb5e oW8IY5B9tqQBQovmQTlUTjRc2vUprbOEJnWAH/ylLg7tGjjl7Tw/G2dcS0dQEfDpooWw 9zYFpI8qp2iOVKwwdYw2OoV7pU0KL06B4jqMaES07EptC2MdJnkNApV/ZEBfMKgMeWdM BoZPPKrNhNcs4Jd7Lkgfqd+1oAuJrRBVzPFA56XNZB8FNI5jVFxJ59FhXcMXJB+AAZr4 Osxg== X-Gm-Message-State: AKGB3mJlvGWnI0DqOuyseCunFheoDg3UDtNLYZxtp/KRl697QESGp53W aBTpJddQEq54JZW3aP9nz0zxxw== X-Google-Smtp-Source: ACJfBosKNXpDuYxmrr06nKdGDVQUzQLFzxGS/5zLMQlANPHn39TcVMnDqXBccvIWDwu6FTh12lB3tw== X-Received: by 10.101.102.75 with SMTP id z11mr12961585pgv.81.1515524376039; Tue, 09 Jan 2018 10:59:36 -0800 (PST) Received: from localhost.localdomain ([103.37.201.27]) by smtp.gmail.com with ESMTPSA id e87sm33962133pfd.165.2018.01.09.10.59.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 10:59:35 -0800 (PST) From: Harsha Sharma To: pablo@netfilter.org, harshasharmaiitr@gmail.com Cc: netfilter-devel@vger.kernel.org Subject: [PATCH 1/2] src: Print handle attribute in chains Date: Wed, 10 Jan 2018 00:29:01 +0530 Message-Id: <5c89bb2dd4af12a952bc3931a93bdb7803d47587.1515521150.git.harshasharmaiitr@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Print handle attribute in chains when listing via '-a' option. Signed-off-by: Harsha Sharma --- src/rule.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rule.c b/src/rule.c index e875816..7d66c22 100644 --- a/src/rule.c +++ b/src/rule.c @@ -694,7 +694,10 @@ static void chain_print(const struct chain *chain, struct output_ctx *octx) rule_print(rule, octx); nft_print(octx, "\n"); } - nft_print(octx, "\t}\n"); + nft_print(octx, "\t}"); + if (octx->handle > 0) + nft_print(octx, " # handle %" PRIu64, chain->handle.handle.id); + nft_print(octx, "\n"); } void chain_print_plain(const struct chain *chain, struct output_ctx *octx)