Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752634AbZALHng (ORCPT ); Mon, 12 Jan 2009 02:43:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751859AbZALHn0 (ORCPT ); Mon, 12 Jan 2009 02:43:26 -0500 Received: from sovereign.computergmbh.de ([85.214.69.204]:45420 "EHLO sovereign.computergmbh.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbZALHnZ (ORCPT ); Mon, 12 Jan 2009 02:43:25 -0500 Date: Mon, 12 Jan 2009 08:43:23 +0100 (CET) From: Jan Engelhardt To: Patrick McHardy cc: matthltc@us.ibm.com, Matt Cross , LKML , netfilter-devel@vger.kernel.org Subject: Re: [PATCH] ebtables match inverted in 2.6.28? (Was: Re: ebtables match inverted in 2.6.28?) In-Reply-To: <496AD1C6.9080906@trash.net> Message-ID: References: <84ee33570812311400m5492af64n45c645a13fe91c2c@mail.gmail.com> <1230779772.29793.31.camel@localhost> <496AD1C6.9080906@trash.net> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2010 Lines: 52 On Monday 2009-01-12 06:14, Patrick McHardy wrote: > Matthew Helsley wrote: >> On Wed, 2008-12-31 at 17:00 -0500, Matt Cross wrote: >>> I think the work to move ebtables to use xtables broke ebtables. >>> Specifically, in commit 8cc784eec6676b58e7f60419c88179aaa97bf71c the >>> return value of the match functions was inverted so that they return 1 >>> (true) on matches instead of EBT_MATCH (0), and vice versa (look in >>> ebt_ip.c). The logic in ebtables.c (ebt_do_table() and >>> EBT_MATCH_ITERATE()) expect match functions to return 0 for matches. >>> >>> The patch at the end of this message fixes the problem, but seems a >>> little hacky to me. Who's the right person to address this? > > Jan, could you have a look at this please? That seemds indeed so. Patch is both for 2.6.29-running and 2.6.28. parent 1e8ca9528de86bdb2d73fbdfb27a10131bb5c593 (v2.6.29-rc1-21-g1e8ca95) commit cc46eb3e855b7c1f628e934e01b97f4f2642973e Author: Jan Engelhardt Date: Mon Jan 12 08:40:22 2009 +0100 netfilter: ebtables: fix inversion in match code Signed-off-by: Jan Engelhardt --- net/bridge/netfilter/ebtables.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index fa108c4..9f46235 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c @@ -79,7 +79,7 @@ static inline int ebt_do_match (struct ebt_entry_match *m, { par->match = m->u.match; par->matchinfo = m->data; - return m->u.match->match(skb, par); + return m->u.match->match(skb, par) ? EBT_MATCH : EBT_NOMATCH; } static inline int ebt_dev_check(char *entry, const struct net_device *device) -- # Created with git-export-patch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/