diff options
author | yar <yar@FreeBSD.org> | 2007-03-12 13:08:56 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2007-03-12 13:08:56 +0000 |
commit | 3084e0d1c8c0cdb2e2597237146839d679a8d980 (patch) | |
tree | 034989bada37cfde6ba5ed385e8a258e541f2eff | |
parent | 9e5ccd324fada4bc6ec105d5a5454280b0992040 (diff) | |
download | FreeBSD-src-3084e0d1c8c0cdb2e2597237146839d679a8d980.zip FreeBSD-src-3084e0d1c8c0cdb2e2597237146839d679a8d980.tar.gz |
Attempt to load the kernel module only if we are going to create a
new interface. In other cases loading the module is unwanted and
can lead to ill side effects. One such effect found is as follows:
"kldunload if_foo" tells the module to kill all its interfaces,
which results in messages sent to devd; the module unloads. Then
devd starts processing the messages, which ends up in a etc script
running ifconfig fooX, which reloads the module.
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index e03a54d..6e4aa6a 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -228,9 +228,6 @@ main(int argc, char *argv[]) ifname = *argv; argc--, argv++; - /* check and maybe load support for this interface */ - ifmaybeload(ifname); - ifindex = if_nametoindex(ifname); if (ifindex == 0) { /* @@ -244,6 +241,7 @@ main(int argc, char *argv[]) if (iflen >= sizeof(name)) errx(1, "%s: cloning name too long", ifname); + ifmaybeload(ifname); ifconfig(argc, argv, NULL); exit(0); } |