Make MODCTL_LOAD_FORCE do something.
This commit is contained in:
parent
c81717a5e1
commit
52e9644b6b
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: kern_module.c,v 1.23 2008/10/22 11:16:29 ad Exp $ */
|
/* $NetBSD: kern_module.c,v 1.24 2008/10/22 11:19:15 ad Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||||
@ -33,7 +33,7 @@
|
|||||||
#include "opt_modular.h"
|
#include "opt_modular.h"
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.23 2008/10/22 11:16:29 ad Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.24 2008/10/22 11:19:15 ad Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
@ -511,10 +511,14 @@ module_do_load(const char *filename, bool isdep, int flags,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (!module_compatible(mi->mi_version, __NetBSD_Version__)) {
|
if (!module_compatible(mi->mi_version, __NetBSD_Version__)) {
|
||||||
error = EPROGMISMATCH;
|
|
||||||
module_error("module built for different version of system");
|
module_error("module built for different version of system");
|
||||||
|
if ((flags & MODCTL_LOAD_FORCE) != 0) {
|
||||||
|
module_error("forced load, system may be unstable");
|
||||||
|
} else {
|
||||||
|
error = EPROGMISMATCH;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If a specific kind of module was requested, ensure that we have
|
* If a specific kind of module was requested, ensure that we have
|
||||||
|
Loading…
Reference in New Issue
Block a user