When it's necessary to kldload tun(4), don't forget to re-try to open
tun0. Submitted by: qhwt@myrealbox.com
This commit is contained in:
parent
d5c08743aa
commit
4d28763d29
@ -711,7 +711,8 @@ bundle_Create(const char *prefix, int type, int unit)
|
|||||||
* Attempt to load the tunnel interface KLD if it isn't loaded
|
* Attempt to load the tunnel interface KLD if it isn't loaded
|
||||||
* already.
|
* already.
|
||||||
*/
|
*/
|
||||||
loadmodules(LOAD_VERBOSLY, "if_tun", NULL);
|
if (loadmodules(LOAD_VERBOSLY, "if_tun", NULL))
|
||||||
|
bundle.unit--;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -420,19 +420,25 @@ Concatinate(char *buf, size_t sz, int argc, const char *const *argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
loadmodules(int how, const char *module, ...)
|
loadmodules(int how, const char *module, ...)
|
||||||
{
|
{
|
||||||
|
int loaded = 0;
|
||||||
#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
|
#if defined(__FreeBSD__) && !defined(NOKLDLOAD)
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, module);
|
va_start(ap, module);
|
||||||
while (module != NULL) {
|
while (module != NULL) {
|
||||||
if (modfind(module) == -1 && ID0kldload(module) == -1 &&
|
if (modfind(module) == -1) {
|
||||||
how == LOAD_VERBOSLY)
|
if (ID0kldload(module) == -1) {
|
||||||
|
if (how == LOAD_VERBOSLY)
|
||||||
log_Printf(LogWARN, "%s: Cannot load module\n", module);
|
log_Printf(LogWARN, "%s: Cannot load module\n", module);
|
||||||
|
} else
|
||||||
|
loaded++;
|
||||||
|
}
|
||||||
module = va_arg(ap, const char *);
|
module = va_arg(ap, const char *);
|
||||||
}
|
}
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
#endif
|
#endif
|
||||||
|
return loaded;
|
||||||
}
|
}
|
||||||
|
@ -139,4 +139,4 @@ extern void SetTitle(const char *);
|
|||||||
extern fd_set *mkfdset(void);
|
extern fd_set *mkfdset(void);
|
||||||
extern void zerofdset(fd_set *);
|
extern void zerofdset(fd_set *);
|
||||||
extern void Concatinate(char *, size_t, int, const char *const *);
|
extern void Concatinate(char *, size_t, int, const char *const *);
|
||||||
extern void loadmodules(int, const char *, ...);
|
extern int loadmodules(int, const char *, ...);
|
||||||
|
Loading…
Reference in New Issue
Block a user