From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: Re: [PATCH] libipt_statistic Date: Mon, 02 Jul 2007 16:58:28 +0200 Message-ID: <46891294.9030405@trash.net> References: <4688F979.60606@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Netfilter Development Mailinglist To: NICOLAS BOULIANE Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-devel-bounces@lists.netfilter.org Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org [Don't remove CCs please] NICOLAS BOULIANE wrote: > Hi Patrick, > > First, there's no upper bound check to ensure that `--packet` value is n-1, > so I'm confused. > > if (string_to_number(optarg, 0, 0xFFFFFFFF, > &info->u.nth.packet) == -1) Yes, that should be fixed. > > But even if I do: > --every 4 --packet 2 > The first time it will match the 3th packet > and all next time it will match the 4th packet, which I dont > understand why (technically yes, but philosophically not). > > Matching pattern look like: > 1,2,(3),4,5,6,(7),8,9,10,(11),12,13,14,(15) It starts at zero and goes up to n - 1. So for the second packet you would actually use --packet 1. A bit counterintuitive, I agree, but too late to change.