* Ignore send errors on negotiation, and just try again when they happen.

* This should improve the reliability in case drivers cannot send a packet when
  they are still negotiating the line speed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34454 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-12-03 10:44:05 +00:00
parent c773831b8f
commit 593a0d2d90
+7 -12
View File
@@ -456,12 +456,10 @@ DHCPClient::_Negotiate(dhcp_state state)
_PrepareMessage(request, state); _PrepareMessage(request, state);
// send discover/request message // send discover/request message
status = _SendMessage(socket, state == INIT ? discover : request, _SendMessage(socket, state == INIT ? discover : request,
state != RENEWAL ? broadcast : fServer); state != RENEWAL ? broadcast : fServer);
if (status < B_OK) { // no need to check the status; in case of an error we'll just send
close(socket); // the message again
return status;
}
// receive loop until we've got an offer and acknowledged it // receive loop until we've got an offer and acknowledged it
@@ -477,17 +475,14 @@ DHCPClient::_Negotiate(dhcp_state state)
} }
if (state == INIT) if (state == INIT)
status = _SendMessage(socket, discover, broadcast); _SendMessage(socket, discover, broadcast);
else { else {
status = _SendMessage(socket, request, state != RENEWAL _SendMessage(socket, request,
? broadcast : fServer); state != RENEWAL ? broadcast : fServer);
} }
if (status != B_OK)
break;
continue; continue;
} else if (bytesReceived < B_OK) } else if (bytesReceived < 0)
break; break;
dhcp_message *message = (dhcp_message *)buffer; dhcp_message *message = (dhcp_message *)buffer;