Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752884AbZIBQGB (ORCPT ); Wed, 2 Sep 2009 12:06:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752503AbZIBQGA (ORCPT ); Wed, 2 Sep 2009 12:06:00 -0400 Received: from smtp-out.google.com ([216.239.33.17]:62849 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752294AbZIBQF7 convert rfc822-to-8bit (ORCPT ); Wed, 2 Sep 2009 12:05:59 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding:x-system-of-record; b=ofOJEdnhrDFJXuzkv2oleaYI06fncxnr4eZdWviNRo7rARm1PuZuMjzsWbHFo1XWj ZE/5Z/KqzFLRSpTGhgkCQ== MIME-Version: 1.0 In-Reply-To: References: <20090902101417.11561.45663.stgit@jazzy.zrh.corp.google.com> <20090902101527.11561.59498.stgit@jazzy.zrh.corp.google.com> <4A9E8711.1070807@trash.net> <4A9E90E4.9080805@trash.net> Date: Wed, 2 Sep 2009 18:05:54 +0200 Message-ID: Subject: Re: [PATCH 1/3] netfilter: xt_ipvs (netfilter matcher for IPVS) From: Hannes Eder To: Jan Engelhardt Cc: Patrick McHardy , lvs-devel@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, =?ISO-8859-1?Q?Fabien_Duch=EAne?= , Jean-Luc Fortemaison , Julian Anastasov , Julius Volz , Laurent Grawet , Simon Horman , Wensong Zhang Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1298 Lines: 46 On Wed, Sep 2, 2009 at 17:49, Jan Engelhardt wrote: > > On Wednesday 2009-09-02 17:36, Patrick McHardy wrote: >>> >>> Nice, I'll use par->family. >>> >>> So in theory I do not even need a check like the following in the beginning? >>> >>> ? ? ?if (family != NFPROTO_IPV4 >>> #ifdef CONFIG_IP_VS_IPV6 >>> ? ? ? ? ?&& family != NFPROTO_IPV6 >>> #endif >>> ? ? ? ? ? ? ?) { >>> ? ? ? ? ? ? ?match = false; >>> ? ? ? ? ? ? ?goto out; >>> ? ? ?} >> >>With the AF_UNSPEC registration of your match, it might be used > > par->family always contains the NFPROTO of the invoking implementation, > which can never be UNSPEC (except, in future, xtables2 ;-) > > par->match->family however may be UNSPEC if the module works that way. > Which is why we have par->family. > I'll a check_entry function: static bool ipvs_mt_check(const struct xt_mtchk_param *par) { if (par->family != NFPROTO_IPV4 #ifdef CONFIG_IP_VS_IPV6 && par->family != NFPROTO_IPV6 #endif ) return false; return true; } and remove the runtime check in ipvs_mt. -- 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/