From: Florian Westphal Subject: Re: [PATCH RFC 2/3] netfilter: add ipv4 reverse path filter match Date: Tue, 30 Aug 2011 14:57:36 +0200 Message-ID: <20110830125736.GD7548@Chamillionaire.breakpoint.cc> References: <1314350465-19598-1-git-send-email-fw@strlen.de> <1314350465-19598-3-git-send-email-fw@strlen.de> <4E5CD8DA.1010204@trash.net> <20110830124119.GB7548@Chamillionaire.breakpoint.cc> <4E5CDB71.9080504@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Florian Westphal , netfilter-devel@vger.kernel.org To: Patrick McHardy Return-path: Received: from Chamillionaire.breakpoint.cc ([85.10.199.196]:59841 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423Ab1H3M5h (ORCPT ); Tue, 30 Aug 2011 08:57:37 -0400 Content-Disposition: inline In-Reply-To: <4E5CDB71.9080504@trash.net> Sender: netfilter-devel-owner@vger.kernel.org List-ID: Patrick McHardy wrote: > On 30.08.2011 14:41, Florian Westphal wrote: > > Patrick McHardy wrote: > >>> main drawback: > >>> - additional fib lookup to get oif (used as flow key in reverse lookup) > >> > >> As discussed during the workshop, we could just perform input routing > >> in the module to get the oif for free. That would require to take care > >> of statistics as currently done in ip_rcv_finish() though. > > > > Right. > > Any idea on how to solve the 'struct sk_buff *' (ip_route_input) vs. > > 'const struct sk_buff *' (matches) problem? > > > > We'd have to modify all the match signatures... > > Some modules already remove the const by casting it away, not > pretty, but works. Since the kernel doesn't assume strict aliasing > this also shouldn't cause any problems in the future. Alternatively > we can change the function signatures of course, although that would > be a bit unfortunate just for this special case. Agreed, modifying the match function signature for this case would be sad. I'll wait a couple of days and will send an updated version that uses the ugly cast + ip_route_input. Thanks for your input!