diff options
author | thompsa <thompsa@FreeBSD.org> | 2007-05-22 17:41:09 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2007-05-22 17:41:09 +0000 |
commit | fca21956cbcff5f887587646cb3ad8dcb4911fb1 (patch) | |
tree | 3e11cae96fa5ca1f0c00c5fa1ff4238c51138111 /sbin/ifconfig/ifconfig.c | |
parent | d3faad37202c3a03e60e6179a537ca83672fce7a (diff) | |
download | FreeBSD-src-fca21956cbcff5f887587646cb3ad8dcb4911fb1.zip FreeBSD-src-fca21956cbcff5f887587646cb3ad8dcb4911fb1.tar.gz |
Add the -n flag for disabling automatic module loading, this will be used by
rc.d to stop it reloading the network module on unload.
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index e03a54d..2f502b5 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -89,6 +89,7 @@ int doalias; int clearaddr; int newaddr = 1; int verbose; +int noload; int supmedia = 0; int printkeys = 0; /* Print keying material for interfaces. */ @@ -150,10 +151,10 @@ main(int argc, char *argv[]) struct option *p; size_t iflen; - all = downonly = uponly = namesonly = verbose = 0; + all = downonly = uponly = namesonly = noload = verbose = 0; /* Parse leading line options */ - strlcpy(options, "adklmuv", sizeof(options)); + strlcpy(options, "adklmnuv", sizeof(options)); for (p = opts; p != NULL; p = p->next) strlcat(options, p->opt, sizeof(options)); while ((c = getopt(argc, argv, options)) != -1) { @@ -173,6 +174,9 @@ main(int argc, char *argv[]) case 'm': /* show media choices in status */ supmedia = 1; break; + case 'n': /* suppress module loading */ + noload++; + break; case 'u': /* restrict scan to "up" interfaces */ uponly++; break; @@ -898,6 +902,10 @@ ifmaybeload(const char *name) char ifkind[35], *dp; const char *cp; + /* loading suppressed by the user */ + if (noload) + return; + /* turn interface and unit into module name */ strcpy(ifkind, "if_"); for (cp = name, dp = ifkind + 3; |