From patchwork Sun Sep 22 08:18:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuseppe Longo X-Patchwork-Id: 276951 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 1066F2C007A for ; Sun, 22 Sep 2013 18:19:18 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752725Ab3IVITP (ORCPT ); Sun, 22 Sep 2013 04:19:15 -0400 Received: from mail-ea0-f169.google.com ([209.85.215.169]:59648 "EHLO mail-ea0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752615Ab3IVITO (ORCPT ); Sun, 22 Sep 2013 04:19:14 -0400 Received: by mail-ea0-f169.google.com with SMTP id k11so1085048eaj.14 for ; Sun, 22 Sep 2013 01:19:13 -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:in-reply-to:references; bh=13/64oS9QfMxILeyJ/tQkRM5/sboC2ZWM1uzKVMwBPY=; b=pb7wNTrq3uDNSkipmID9KJ8vwpqroscb7uhVMcT2JWNdTV3cjlGuNBGK1wFrsZ63aL np5Pd8QmLUTthHGL2IkWGU/8rXwWbROGn2hIBu6dKGknjK+a0ZMC+rKT1lEbQ46MCKI7 f9NQWaUJOA7+GaHUJPccd+W95y2ZfgjdvjhpsYjrK4KYA0FGhgJ8OXqU4cIheJhLAbs9 pVCQKuMUzLZT+VadLyeflyLPD8L2K5OTfKiDG5LY1pbSh8Iz8CpbWLRtRQ6iUmzWctQ6 n8HwJR1qOHjmpVIydD7KrcuFmyvcFU38AaUaTo0GT2w8m05Rt4DVT8wesHxcL4RxA0CN QIBA== X-Received: by 10.15.43.13 with SMTP id w13mr25822662eev.37.1379837953765; Sun, 22 Sep 2013 01:19:13 -0700 (PDT) Received: from localhost.localdomain ([46.182.88.92]) by mx.google.com with ESMTPSA id y47sm32561171eew.12.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 22 Sep 2013 01:19:13 -0700 (PDT) From: Giuseppe Longo To: netfilter-devel@vger.kernel.org Cc: Giuseppe Longo Subject: [iptables-nftables PATCH 2/2] xtables: arp: zeroing chain counters Date: Sun, 22 Sep 2013 10:18:56 +0200 Message-Id: <1379837936-2813-2-git-send-email-giuseppelng@gmail.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1379837936-2813-1-git-send-email-giuseppelng@gmail.com> References: <1379837936-2813-1-git-send-email-giuseppelng@gmail.com> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org This small patch permit to reset the chain counters. Signed-off-by: Giuseppe Longo --- iptables/xtables-arp.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/iptables/xtables-arp.c b/iptables/xtables-arp.c index 4537a58..2f43ce8 100644 --- a/iptables/xtables-arp.c +++ b/iptables/xtables-arp.c @@ -1462,9 +1462,8 @@ int do_commandarp(struct nft_handle *h, int argc, char *argv[], char **table) options&OPT_NUMERIC, /*options&OPT_EXPANDED*/0, options&OPT_LINENUMBERS); - /*if (ret) - ret = zero_entries(chain, - options&OPT_VERBOSE, handle);*/ + if (ret && (command & CMD_ZERO)) + ret = nft_chain_zero_counters(h, chain, *table); break; case CMD_NEW_CHAIN: ret = nft_chain_user_add(h, chain, *table);