Fixed very stupid bug.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14384 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -716,11 +716,12 @@ PPPManager::SettingsChanged()
|
|||||||
// get default interface name and update interfaces if it changed
|
// get default interface name and update interfaces if it changed
|
||||||
void *handle = load_driver_settings("ptpnet.settings");
|
void *handle = load_driver_settings("ptpnet.settings");
|
||||||
const char *name = get_driver_parameter(handle, "default", NULL, NULL);
|
const char *name = get_driver_parameter(handle, "default", NULL, NULL);
|
||||||
unload_driver_settings(handle);
|
|
||||||
|
|
||||||
if((!fDefaultInterface && !name) || (fDefaultInterface && name
|
if((!fDefaultInterface && !name) || (fDefaultInterface && name
|
||||||
&& !strcmp(name, fDefaultInterface)))
|
&& !strcmp(name, fDefaultInterface))) {
|
||||||
|
unload_driver_settings(handle);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ppp_interface_entry *entry = EntryFor(fDefaultInterface);
|
ppp_interface_entry *entry = EntryFor(fDefaultInterface);
|
||||||
if(entry && entry->interface->StateMachine().Phase() == PPP_DOWN_PHASE)
|
if(entry && entry->interface->StateMachine().Phase() == PPP_DOWN_PHASE)
|
||||||
@@ -729,11 +730,13 @@ PPPManager::SettingsChanged()
|
|||||||
free(fDefaultInterface);
|
free(fDefaultInterface);
|
||||||
if(!name) {
|
if(!name) {
|
||||||
fDefaultInterface = NULL;
|
fDefaultInterface = NULL;
|
||||||
|
unload_driver_settings(handle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fDefaultInterface = strdup(name);
|
fDefaultInterface = strdup(name);
|
||||||
ppp_interface_id id = CreateInterfaceWithName(name);
|
unload_driver_settings(handle);
|
||||||
|
ppp_interface_id id = CreateInterfaceWithName(fDefaultInterface);
|
||||||
entry = EntryFor(id);
|
entry = EntryFor(id);
|
||||||
if(entry)
|
if(entry)
|
||||||
entry->interface->SetConnectOnDemand(true);
|
entry->interface->SetConnectOnDemand(true);
|
||||||
@@ -814,12 +817,8 @@ PPPManager::_CreateInterface(const char *name,
|
|||||||
locker.UnlockNow();
|
locker.UnlockNow();
|
||||||
// it is safe to access the manager from userland now
|
// it is safe to access the manager from userland now
|
||||||
|
|
||||||
if(!Report(PPP_MANAGER_REPORT, PPP_REPORT_INTERFACE_CREATED,
|
Report(PPP_MANAGER_REPORT, PPP_REPORT_INTERFACE_CREATED, &id,
|
||||||
&id, sizeof(ppp_interface_id))) {
|
sizeof(ppp_interface_id)));
|
||||||
DeleteInterface(id);
|
|
||||||
atomic_add(&entry->accessing, -1);
|
|
||||||
return PPP_UNDEFINED_INTERFACE_ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
// notify handlers that interface has been created and they can initialize it now
|
// notify handlers that interface has been created and they can initialize it now
|
||||||
entry->interface->StateMachine().DownProtocols();
|
entry->interface->StateMachine().DownProtocols();
|
||||||
|
|||||||
Reference in New Issue
Block a user