aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/module.h
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-16 16:47:46 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-16 16:47:46 +0000
commit784b683ab46ce427ce7db49fa7c9446f1748413d (patch)
treeea35c041ff49971003f752a43dc0d78eb12afb7b /include/asterisk/module.h
parent3703e314eb603926e389b01bcfb731034a6c0504 (diff)
To help combat problems where people build external modules (asterisk-addons or others) and then change the build options of the Asterisk build in a way that makes the incompatible without warning, this commit introduces an MD5 signature of the important build-time options and includes that signature into modules when they are built. When the loader loads one of these modules and notices the problem, it will emit a warning to console and refuse to initialize the module, as doing so could cause the system to be unstable or even crash.
If you upgrade to this version of Asterisk, you must rebuild *all* of your modules that came from other sources before trying to run this version. If you are using Digium's G.729 binary codec module, you will need v33 or newer. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89325 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/module.h')
-rw-r--r--include/asterisk/module.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/asterisk/module.h b/include/asterisk/module.h
index 7f14df7f9..2c39cc2d7 100644
--- a/include/asterisk/module.h
+++ b/include/asterisk/module.h
@@ -203,6 +203,7 @@ struct ast_module_info {
const char *key;
unsigned int flags;
+ unsigned int buildopt_sum[4]; /* The value of AST_BUILDOPT_SUM when this module was compiled */
};
void ast_module_register(const struct ast_module_info *);
@@ -229,7 +230,8 @@ void ast_module_unref(struct ast_module *);
AST_MODULE, \
desc, \
keystr, \
- flags_to_set \
+ flags_to_set, \
+ AST_BUILDOPT_SUM, \
}; \
static void __attribute__ ((constructor)) __reg_module(void) \
{ \
@@ -259,6 +261,7 @@ const static __attribute__((unused)) struct ast_module_info *ast_module_info;
.flags = flags_to_set, \
.description = desc, \
.key = keystr, \
+ .buildopt_sum = AST_BUILDOPT_SUM, \
fields \
}; \
static void __attribute__ ((constructor)) __reg_module(void) \