summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2007-03-12 13:08:56 +0000
committeryar <yar@FreeBSD.org>2007-03-12 13:08:56 +0000
commit3084e0d1c8c0cdb2e2597237146839d679a8d980 (patch)
tree034989bada37cfde6ba5ed385e8a258e541f2eff /sbin
parent9e5ccd324fada4bc6ec105d5a5454280b0992040 (diff)
downloadFreeBSD-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.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.c4
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);
}
OpenPOWER on IntegriCloud