From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Westphal Subject: Re: [PATCH 1/5] netfilter: add nf_ipv6_ops hook to fix xt_addrtype with IPv6 Date: Mon, 3 Jun 2013 00:06:45 +0200 Message-ID: <20130602220645.GA14760@breakpoint.cc> References: <1369843394-24251-1-git-send-email-pablo@netfilter.org> <1369843394-24251-2-git-send-email-pablo@netfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Pablo Neira Ayuso , netfilter-devel@vger.kernel.org, David Miller , "netdev@vger.kernel.org" , Eric Dumazet To: Lorenzo Colitti Return-path: Received: from Chamillionaire.breakpoint.cc ([80.244.247.6]:57895 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754393Ab3FBWGv (ORCPT ); Sun, 2 Jun 2013 18:06:51 -0400 Content-Disposition: inline In-Reply-To: Sender: netfilter-devel-owner@vger.kernel.org List-ID: Lorenzo Colitti wrote: > > While the former might seem preferable, Pablo pointed out that there > > are more xt modules with link-time dependeny issues regarding ipv6, > > so lets go for 2). > > I had to do this recently for the ping socket as well: > > http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67 > > +/* Compatibility glue so we can support IPv6 when it's compiled as a module */ > +struct pingv6_ops { > [...] > + int (*ipv6_chk_addr)(struct net *net, const struct in6_addr *addr, > + struct net_device *dev, int strict); > +}; > > Is it a better idea to share these structures and have just one > structure containing all IPv6 dummy functions? I think so, yes. > If it was in an include > file, it would be easily accessible to most of the tree even when > CONFIG_IPV6={n,m}, and we could have the ipv6 module init (and exit) > code just set all the function pointers. That way, we wouldn't have to > reinvent this particular wheel in multiple places of the code. FWIW, I agree. We should avoid having multiple copies of this.