Network interface modules keeps re-loading
Andrew Thompson
thompsa at freebsd.org
Sat May 12 20:20:06 UTC 2007
On Sat, May 12, 2007 at 06:17:38PM +0200, Fredrik Lindberg wrote:
> Hi
>
> Due to some exciting interaction between kldunload, devctl/devd, rc(8)
> and ifconfig it's currently impossible to unload a network interface
> module (without stopping devd first).
>
> The feature of having ifconfig loading modules was discussed briefly
> on current@ a while ago, but apparently nothing came out of it.
>
> ifmaybeload() is called quite early in ifconfig, my suggestion is to
> only call it if there is at least one more argument except the interface
> name given on the command line.
> diff -u -u -r1.130 ifconfig.c
> --- ifconfig.c 24 Mar 2007 20:26:54 -0000 1.130
> +++ ifconfig.c 12 May 2007 16:13:39 -0000
> @@ -229,7 +229,8 @@
> argc--, argv++;
>
> /* check and maybe load support for this interface */
> - ifmaybeload(ifname);
> + if (argc >= 1)
> + ifmaybeload(ifname);
A similar solution to this was committed in rev1.129 of ifconfig.c but
then backed out later as the module loading proved to be feature used by
quite a few people. I think an example was being able to load and
initialise an interface by just trying 'ifconfig foo0'.
I think a different way to solve this is to add a argument to ifconfig
to suppress the module loading and then use it at the appropriate places
in rc.
Andrew
More information about the freebsd-current
mailing list