Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2365 → Rev 2366

/kernel/branches/net/network/stack.inc
172,7 → 172,8
uglobal
 
NET_RUNNING dd ?
NET_DRV_LIST rd (MAX_NET_DEVICES + 1) ; device 0 is a link to the default device
NET_DEFAULT dd ?
NET_DRV_LIST rd MAX_NET_DEVICES
 
endg
 
276,7 → 277,7
; Check if device is already listed
mov eax, ebx
mov ecx, MAX_NET_DEVICES ; We need to check whole list because a device may be removed without re-organizing list
mov edi, NET_DRV_LIST+4
mov edi, NET_DRV_LIST
 
repne scasd ; See if device is already in the list
jz .error
285,7 → 286,7
; Find empty slot in the list
xor eax, eax
mov ecx, MAX_NET_DEVICES
mov edi, NET_DRV_LIST+4
mov edi, NET_DRV_LIST
 
repne scasd
jnz .error
340,8 → 341,7
cmp [NET_DRV_LIST+eax*4], 0
je .error
 
push [NET_DRV_LIST+eax*4]
pop [NET_DRV_LIST]
mov [NET_DEFAULT], eax
 
DEBUGF 1,"Device number %u is now default!\n", eax
ret
377,11 → 377,12
; there are still active devices, find one and make it default
xor eax, eax
mov ecx, MAX_NET_DEVICES
mov edi, NET_DRV_LIST+4
mov edi, NET_DRV_LIST
repe scasd
je @f
push dword [edi-4]
pop [NET_DRV_LIST]
shr edi, 2
dec edi
mov [NET_DEFAULT], edi
@@:
 
;----------------------------
422,7 → 423,7
push ecx
 
mov ecx, MAX_NET_DEVICES
mov edi, NET_DRV_LIST+4
mov edi, NET_DRV_LIST
 
.loop:
cmp ebx, [edi]
569,7 → 570,7
;
;----------------------------------------------------------------
align 4
sys_network:
sys_network: ; FIXME: make default device easily accessible
 
cmp ebx, -1
jne @f
/kernel/branches/net/network/udp.inc
165,11 → 165,13
 
;;; TODO: when packet is processed, check more sockets!
 
cmp [eax + IP_SOCKET.RemoteIP], 0xffffffff
je @f
cmp [eax + IP_SOCKET.RemoteIP], edi
jne .next_socket
@@:
; cmp [eax + IP_SOCKET.RemoteIP], 0xffffffff
; je @f
; cmp [eax + IP_SOCKET.RemoteIP], edi
; jne .next_socket
; @@:
;
; FIXME: UDP should check remote IP, but not under all circumstances!
 
cmp [eax + UDP_SOCKET.firstpacket], 0
je .updateport