From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: Re: [PATCH] netfilter: fix arptable_filter wrong hook registering Date: Thu, 16 Oct 2008 13:52:39 +0200 Message-ID: <48F72B07.1040706@trash.net> References: <20081016012451.6126.34071.stgit@Decadence> <48F69EF2.5000104@netfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Pablo Neira Ayuso , netfilter-devel@vger.kernel.org To: Jan Engelhardt Return-path: Received: from stinky.trash.net ([213.144.137.162]:64326 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756788AbYJPLwp (ORCPT ); Thu, 16 Oct 2008 07:52:45 -0400 In-Reply-To: Sender: netfilter-devel-owner@vger.kernel.org List-ID: Jan Engelhardt wrote: > On Wednesday 2008-10-15 21:54, Pablo Neira Ayuso wrote: > >>> Perhaps the following helps? >> Yes, your patch will also work, but it introduces an inconsistency in >> the naming used to register hooks in the family field. > > No, not really. Netfilter Hooks are supposed to register with > .pf = NFPROTO_FOO > instead of > .pf = PF_FOO > because the nf_hooks list itself is indexed by nfproto numbers, > not PF numbers: > > struct list_head nf_hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS] __read_mostly; > > (The fact that there's still PF_ in the source is merely historical, > and as you see, PF_foo == NFPROTO_foo for that exact reason.) I agree with Jan on this one, there doesn't seem to be a reason for not using the NFPROTO constants consistently.