From 0d3fa411d8983b9cb647f0210ff7e492a79108e5 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Tue, 8 Apr 2014 20:05:48 +0000 Subject: [PATCH] Fixed timeout git-svn-id: svn://kolibrios.org@4805 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/network/zeroconf/zeroconf.asm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/programs/network/zeroconf/zeroconf.asm b/programs/network/zeroconf/zeroconf.asm index 518b9ab596..7a6adfd5fb 100644 --- a/programs/network/zeroconf/zeroconf.asm +++ b/programs/network/zeroconf/zeroconf.asm @@ -304,15 +304,21 @@ request_options: send_dhcpmsg: DEBUGF 1,"Sending DHCP discover/request\n" mcall 75, 6, [socketNum], [dhcpMsg], [dhcpMsgLen] ; write to socket ( send broadcast request ) + mcall 26, 9 + add eax, TIMEOUT*100 + mov [timeout], eax .wait: - mcall 23, TIMEOUT*100 ; wait for data + mcall 23, TIMEOUT ; wait for data -read_data: ; we have data - this will be the response +read_data: ; we have data - this will be the response mcall 75, 7, [socketNum], [dhcpMsg], BUFFER, MSG_DONTWAIT ; read data from socket cmp eax, -1 jne @f - cmp ebx, 6 ; EWOULDBLOCK - je send_dhcpmsg.wait + + mcall 26, 9 + cmp eax, [timeout] + jb send_dhcpmsg.wait + DEBUGF 2,"No answer from DHCP server\n" dec [tries] jnz send_dhcpmsg ; try again @@ -571,6 +577,7 @@ link_local: mcall 5, ANNOUNCE_INTERVAL*100 jmp announce_loop @@: + jmp exit error: @@ -670,4 +677,6 @@ generator dd ? dhcpMsg dd ? +timeout dd ? + I_END: \ No newline at end of file