[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1366733588.4016.29.camel@bwh-desktop.uk.solarflarecom.com>
Date: Tue, 23 Apr 2013 17:13:08 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: Bjørn Mork <bjorn@...k.no>
CC: Cong Wang <amwang@...hat.com>, David Miller <davem@...emloft.net>,
<netdev@...r.kernel.org>, <yoshfuji@...ux-ipv6.org>
Subject: Re: [Patch net-next] ipv6: separate out procfs code from mcast.c
On Tue, 2013-04-23 at 14:33 +0200, Bjørn Mork wrote:
> Cong Wang <amwang@...hat.com> writes:
>
> > On Tue, 2013-04-23 at 03:36 -0400, David Miller wrote:
> >> From: Cong Wang <amwang@...hat.com>
> >> Date: Tue, 23 Apr 2013 15:30:20 +0800
> >>
> >> > This is hard to do, as in the email I replied to Stephen. So I
> >> > prefer to just add a Kconfig dependency, at least for now.
> >>
> >> A Kconfig hack is exactly what I've told you is an unacceptable
> >> solution.
> >
> > Please enlighten me for a third solution. :)
>
> This is an completely untested idea....
>
> I note that vxlan_init_net requires a successful sock_create_kern().
> That implies a request_module("net-pf-...") followed by try_module_get.
>
> So if the sock_create_kern(PF_INET6, ..) succeeds then you *know* you
> have IPv6. If it fails with -EAFNOSUPPORT, then you could fall back to
> sock_create_kern(PF_INET, ..) and set a flag indicating that runtime
> IPv6 support is disabled. Then use this flag to allow/deny configuring
> any IPv6 destinations.
>
> You may also have to protect the IPv6 modular symbols you use with
> symbol_request() or similar to prevent vxlan from depending on IPv6. I
> dunno...
>
> If nothing else, I believe this is a crazy enough hack that David may
> want to reconsider one of your other two solutions :)
A more type-safe approach would be to define something like:
/* net/ipv6.h */
struct ipv6_mcast_ops {
...
};
extern const struct ipv6_mcast_ops *ipv6_mcast_ops;
/* net/ipv6/addrconf_core.c */
const struct ipv6_mcast_ops *ipv6_mcast_ops;
EXPORT_SYMBOL_GPL(ipv6_mcast_ops);
/* net/ipv6/af_inet6.c */
static const struct ipv6_mcast_ops ipv6_mcast_ops_impl = {
...
};
static int __init inet6_init(void)
{
...
ipv6_mcast_ops = &ipv6_mcast_ops_impl;
return 0;
...
}
static void __exit inet6_exit(void)
{
...
ipv6_mcast_ops = NULL;
...
}
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists