Adding missing check that a plugin's API version matches what Bro defines.

This commit is contained in:
Robin Sommer 2014-07-31 10:08:50 -07:00
parent 024c26d982
commit 382b946098
5 changed files with 27 additions and 9 deletions

View file

@ -219,6 +219,10 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
current_plugin->SetDynamic(true);
current_plugin->DoConfigure();
if ( current_plugin->APIVersion() != BRO_PLUGIN_API_VERSION )
reporter->FatalError("plugin's API version does not match Bro (expected %d, got %d in %s)",
BRO_PLUGIN_API_VERSION, current_plugin->APIVersion(), path);
// We execute the pre-script initialization here; this in
// fact could be *during* script initialization if we got
// triggered via @load-plugin.