Fixed seg fault when mods for some reason fail fail to load.
This commit is contained in:
parent
4995cac9b8
commit
79b688c38e
@ -190,7 +190,10 @@ struct cw_Mod *cw_mod_load(const char *mod_name, cw_Cfg_t * global_cfg, int role
|
||||
}
|
||||
|
||||
cw_dbg(DBG_MOD, "MOD: %s sucessfull loaded, calling init now.", filename);
|
||||
mod->init(mod, global_cfg, role);
|
||||
if (!mod->init(mod, global_cfg, role)){
|
||||
dlclose(handle);
|
||||
mod=NULL;
|
||||
}
|
||||
|
||||
errX:
|
||||
free(filename);
|
||||
|
@ -30,7 +30,7 @@ static int init(struct cw_Mod * mod, cw_Cfg_t * global_cfg, int role)
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
static int init()
|
||||
{
|
||||
cw_dbg(DBG_INFO, "Initialiazing mod_capwap80211 ...");
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -117,11 +117,13 @@ static int init(struct cw_Mod *mod, cw_Cfg_t * global_cfg, int role)
|
||||
capwap_mod = cw_mod_load("capwap",global_cfg,role);
|
||||
if (capwap_mod == NULL){
|
||||
cw_log(LOG_ERR, "CISCO: failed to load base module 'capwap");
|
||||
return 0;
|
||||
}
|
||||
|
||||
capwap80211_mod = cw_mod_load("capwap80211", global_cfg,role);
|
||||
if (capwap_mod == NULL){
|
||||
cw_log(LOG_ERR, "CISCO: failed to load base module 'capwap80211");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*cisco_config = mbag_create();*/
|
||||
|
Loading…
Reference in New Issue
Block a user