Improved 'tries' counter for zeroconf.

git-svn-id: svn://kolibrios.org@3636 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-06-10 18:29:41 +00:00
parent 6a2df080e4
commit d010a4e7fe

View File

@ -195,8 +195,6 @@ START:
try_dhcp: try_dhcp:
mov [tries], DHCP_TRIES
DEBUGF 1,"->Trying DHCP\n" DEBUGF 1,"->Trying DHCP\n"
mcall 75, 0, AF_INET4, SOCK_DGRAM, 0 ; open socket (parameters: domain, type, reserved) mcall 75, 0, AF_INET4, SOCK_DGRAM, 0 ; open socket (parameters: domain, type, reserved)
@ -227,6 +225,8 @@ try_dhcp:
build_request: ; Creates a DHCP request packet. build_request: ; Creates a DHCP request packet.
mov [tries], DHCP_TRIES
DEBUGF 1,"->Building request\n" DEBUGF 1,"->Building request\n"
stdcall mem.Alloc, BUFFER stdcall mem.Alloc, BUFFER
@ -275,9 +275,9 @@ build_request: ; Creates a DHCP request
cmp [dhcpMsgType], byte 0x01 ; Check which msg we are sending cmp [dhcpMsgType], byte 0x01 ; Check which msg we are sending
jne request_options jne request_options
mov [edx+240+21], byte 0xff ; "Discover" options mov [edx+240+21], byte 0xff ; end of options marker
mov [dhcpMsgLen], dword 262 ; end of options marker mov [dhcpMsgLen], 262 ; length
jmp send_dhcpmsg jmp send_dhcpmsg
request_options: request_options:
@ -287,10 +287,10 @@ request_options:
mov [edx+240+27], byte 0xff ; end of options marker mov [edx+240+27], byte 0xff ; end of options marker
mov [dhcpMsgLen], dword 268 mov [dhcpMsgLen], 268 ; length
send_dhcpmsg: send_dhcpmsg:
DEBUGF 1,"Sending DHCP request\n" DEBUGF 1,"Sending DHCP discover/request\n"
mcall 75, 6, [socketNum], [dhcpMsg], [dhcpMsgLen] ; write to socket ( send broadcast request ) mcall 75, 6, [socketNum], [dhcpMsg], [dhcpMsgLen] ; write to socket ( send broadcast request )
mcall 23, TIMEOUT*100 ; wait for data mcall 23, TIMEOUT*100 ; wait for data
@ -336,6 +336,7 @@ discover:
jmp link_local jmp link_local
send_request: send_request:
DEBUGF 1, "Got offer, making request\n"
mov [dhcpMsgType], 0x03 ; make it a request mov [dhcpMsgType], 0x03 ; make it a request
jmp build_request jmp build_request
@ -345,6 +346,8 @@ request:
cmp [dhcpMsgType], 0x05 ; Was the response an ACK? It should be cmp [dhcpMsgType], 0x05 ; Was the response an ACK? It should be
jne read_data ; NO - read next packets jne read_data ; NO - read next packets
DEBUGF 1, "Got ACK, applying settings\n"
call dhcp_end call dhcp_end
mov ebx, API_IPv4 + 3 mov ebx, API_IPv4 + 3