Re: detaching ethernet interfaces..
Re: detaching ethernet interfaces..
- Subject: Re: detaching ethernet interfaces..
- From: Andrew Gallatin <email@hidden>
- Date: Fri, 25 Jan 2002 17:26:06 -0500 (EST)
Justin C. Walker writes:
>
On Friday, January 25, 2002, at 12:53 PM, Andrew Gallatin wrote:
>
>
> Is it possible to detach an ethernet interface in 10.1 / Darwin 1.4
>
> after it has been ifconfig'ed up? (and down again)
>
>
>
> Eg, looking at the source code for ether_attach_inet, I see:
>
>
>
> /* XXX avoid free'ing the interface */
>
> ifp->if_eflags |= IFEF_DETACH_DISABLED;
>
>
>
> I don't see IFEF_DETACH_DISABLED being cleared anywhere. So it looks
>
> as though an interface becomes unloadable once its been configured.
>
> Is this true? Why??
>
>
You mean "un-unloadable", right?
Ooops, yes. My mother always told me to avoid double negatives.. ;)
>
It is true. Currently, while you can unload drivers in general, Darwin
>
doesn't have the necessary mechanisms to run down all the stashed copies
>
of the pointer to the driver's 'ifnet' structure. Therefore, if we did
>
allow unloading, it would likely to come back to haunt us (in the form
>
of a DSI, or other nasty surprise, when referencing a location that's no
>
longer valid in kernel memory).
OK. Darn. Well, ifnet is not so big & I'd be happy to leak it. I'm
not using any IOKit Network* stuff, so I'm in control & I can leak it
if I need to..
While I've got your attention:
Do you have any plans to accommodate jumbo frames? It looks like I'm
going to have to somehow override ether_inet_prmod_ioctl() to allow
setting a 9000 byte mtu on my device. For now, I'm just resetting
if_mtu after calling ether_ifattach(), but it would be nice to allow
the user to change the mtu..
Thanks,
Drew