Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2622 → Rev 2621

/kernel/branches/net/network/socket.inc
383,29 → 383,12
cmp esi, 6
jb s_error
 
cmp [eax + SOCKET.Protocol], IP_PROTO_UDP
je .udp
pushw [edx + 2]
pop [eax + UDP_SOCKET.LocalPort]
 
cmp [eax + SOCKET.Protocol], IP_PROTO_TCP
je .tcp
pushd [edx + 4]
pop [eax + IP_SOCKET.LocalIP]
 
jmp s_error
 
.tcp:
.udp:
 
mov ebx, [edx + 4] ; First, fill in the IP
test ebx, ebx ; If IP is 0, use default
jnz @f
mov ebx, [NET_DEFAULT]
mov ebx, [IP_LIST + 4*ebx]
@@:
mov [eax + IP_SOCKET.LocalIP], ebx
 
mov bx, [edx + 2] ; Now fill in the port if it's still available
call SOCKET_check_port
jz s_error ; ZF is set by socket_check_port, on error
 
DEBUGF 1,"local ip: %u.%u.%u.%u\n",\
[eax + IP_SOCKET.LocalIP + 0]:1,[eax + IP_SOCKET.LocalIP + 1]:1,\
[eax + IP_SOCKET.LocalIP + 2]:1,[eax + IP_SOCKET.LocalIP + 3]:1
1038,7 → 1021,6
DEBUGF 1,"SOCKET_check_port\n"
 
mov ecx, [eax + SOCKET.Protocol]
mov edx, [eax + IP_SOCKET.LocalIP]
mov esi, net_sockets
 
.next_socket:
1049,9 → 1031,6
cmp [esi + SOCKET.Protocol], ecx
jne .next_socket
 
cmp [esi + IP_SOCKET.LocalIP], edx
jne .next_socket
 
cmp [esi + UDP_SOCKET.LocalPort], bx
jne .next_socket