Avoid deadlock.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41278 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin
2011-04-23 01:52:16 +00:00
parent 302a7082ba
commit 9ff5266f3a
4 changed files with 82 additions and 47 deletions
+8 -10
View File
@@ -58,21 +58,19 @@ AutoconfigLooper::_RemoveClient()
void
AutoconfigLooper::_Configure()
{
// start with DHCP
if (fCurrentClient == NULL) {
fCurrentClient = new DHCPClient(fTarget, fDevice.String());
AddHandler(fCurrentClient);
}
// set IFF_CONFIGURING flag on interface
BNetworkInterface interface(fDevice.String());
int32 flags = interface.Flags() & ~IFF_AUTO_CONFIGURED;
interface.SetFlags(flags | IFF_CONFIGURING);
// remove current handler
_RemoveClient();
// start with DHCP
fCurrentClient = new DHCPClient(fTarget, fDevice.String());
AddHandler(fCurrentClient);
if (fCurrentClient->Initialize() == B_OK)
return;
@@ -91,7 +89,7 @@ AutoconfigLooper::_Configure()
BMessage message(kMsgConfigureInterface);
message.AddString("device", fDevice.String());
message.AddBool("auto", true);
message.AddBool("auto_configured", true);
BNetworkAddress link;
uint8 last = 56;