[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1366774419.3849.8.camel@cr0>
Date: Wed, 24 Apr 2013 11:33:39 +0800
From: Cong Wang <amwang@...hat.com>
To: Ben Hutchings <bhutchings@...arflare.com>
Cc: Bjørn Mork <bjorn@...k.no>,
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 17:13 +0100, Ben Hutchings wrote:
>
> 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;
> ...
> }
Yeah! That's a nice stub! I think this is the only doable and acceptable
solution so far.
Thanks a lot!
--
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