- To: ecos-discuss@xxxxxxxxxxxxxxxxxx
- Subject: Re: Disable IPv6 at startup?
- From: Grant Edwards <grant.b.edwards@xxxxxxxxx>
- Date: Thu, 1 Mar 2012 14:35:30 +0000 (UTC)
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- User-agent: slrn/pre0.9.9-102 (Linux)
On 2012-03-01, Sergei Gavrikov <sergei.gavrikov@xxxxxxxxx> wrote:
> On Wed, 29 Feb 2012, Grant Edwards wrote:
>
> [snip]
>
>> OK, I've come up with something I like a little better. The only
>> change it requires to the network stack is that ip6_init2() needs to
>> be globally visible (ip6_init already is, so I don't see the harm in
>> making ip6_init2 visible). If ip6_init2 is visible, then you can
>> disable ipv6 support with this code:
>>
>> static void init_noop(void* dummy)
>> {
>> }
>>
>> static void disable_ipv6(void)
>> {
>> extern void cyg_net_add_domain(void *);
>> extern void ip6_init2(void *);
>> extern char inet6domain[];
>> extern struct init_tab_entry __NET_INIT_TAB__[], __NET_INIT_TAB_END__;
>> struct init_tab_entry *init_entry;
>>
>> for (init_entry = __NET_INIT_TAB__; init_entry != &__NET_INIT_TAB_END__; init_entry++)
>> if ((init_entry->fun == cyg_net_add_domain && init_entry->data == (void*)inet6domain) ||
>> (init_entry->fun == ip6_init2))
>> init_entry->fun = init_noop;
>> }
In case anybody is wondering, ip6_init() is called via the domain
startup code via a pointer that's present in the "struct domain"
initializer for inet6domain. Disabling the call to
cyg_net_add_domain(&inet6domain) as shown above is what prevents
ip6_init() from being called.
> IMHO, it is neat solution. Thanks for usage example. BTW, the KAME's
> successors had declared ip6_init2() as you suggest:
>
> http://ftp.fr.openbsd.org/pub/OpenBSD/src/sys/netinet6/ip6_input.c
>
> Please, submit the patch.
OK, will do. I noticed after that last post that ip6_init is renamed
to cyg_ip6_init by one of the include files. I assume I should do the
same thing for ip6_init2 if it's going to be global?
--
Grant Edwards grant.b.edwards Yow! But was he mature
at enough last night at the
gmail.com lesbian masquerade?
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
[Linux Embedded]
[U-Boot V2]
[Linux Kernel]
[Linux MIPS]
[Linux ARM]
[Linux for the Blind]
[Linux Resources]
[Photo]
[Yosemite]
[ISDN Cause Codes]
[ECOS Home]
[Site Home]