forked from KolibriOS/kolibrios
Bugfixes in net branch:
-Disabled UDP remote IP checking because it blocks valid packets in certain situations (DNS resolving) -Removed device '0' (application level) as default device because it was not correctly implemented and would require a lot of changes. Yet need to find a better solution for this. git-svn-id: svn://kolibrios.org@2366 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
599bb8d0bd
commit
dc66507e60
@ -172,7 +172,8 @@ align 4
|
||||
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 @@ NET_add_device:
|
||||
; 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 @@ NET_add_device:
|
||||
; 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 @@ NET_set_default:
|
||||
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 @@ NET_remove_device:
|
||||
; 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 @@ NET_ptr_to_num:
|
||||
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 @@ checksum_2:
|
||||
;
|
||||
;----------------------------------------------------------------
|
||||
align 4
|
||||
sys_network:
|
||||
sys_network: ; FIXME: make default device easily accessible
|
||||
|
||||
cmp ebx, -1
|
||||
jne @f
|
||||
|
@ -165,11 +165,13 @@ UDP_input:
|
||||
|
||||
;;; 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
|
||||
|
Loading…
Reference in New Issue
Block a user