Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1334 → Rev 1335

/kernel/branches/net/network/socket.inc
76,6 → 76,7
 
.LocalPort dw ? ; In INET byte order
.RemotePort dw ? ; In INET byte order
.firstpacket db ?
 
.end:
ends
343,6 → 344,7
 
mov bx , word [edx + 2]
mov word [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.RemotePort], bx
mov [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.firstpacket], 0
DEBUGF 1,"remote port: %x ",bx
 
mov ebx, dword [edx + 4]
/kernel/branches/net/network/udp.inc
140,11 → 140,13
DEBUGF 1,"Remote Ip matches\n"
.ok1:
 
mov bx, [edx + UDP_Packet.SourcePort] ; Remote port must be 0, or equal to sourceport of packet
lea ebx, [eax + SOCKET_head.lock]
call wait_mutex
 
cmp [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.RemotePort], 0
je .ok2
cmp [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.firstpacket], 0
jz .updateport
 
mov bx, [edx + UDP_Packet.SourcePort]
cmp [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.RemotePort], bx
jne .dump
 
155,13 → 157,7
movzx ecx, [edx + UDP_Packet.Length]
rol cx , 8
sub cx , UDP_Packet.Data
mov dx , bx
 
 
lea ebx, [eax + SOCKET_head.lock]
call wait_mutex
mov [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.RemotePort], dx ; update remote port number
mov [eax + SOCKET_head.end + IPv4_SOCKET.RemoteIP], edi
inc [UDP_PACKETS_RX]
 
pop edi
172,6 → 168,15
jmp socket_internal_receiver
 
 
.updateport:
 
mov bx, [edx + UDP_Packet.SourcePort]
DEBUGF 1,"Changing remote port to: %x\n", bx
mov [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.RemotePort], bx
inc [eax + SOCKET_head.end + IPv4_SOCKET.end + UDP_SOCKET.firstpacket]
 
jmp .ok2
 
.dump:
DEBUGF 1,"Dumping UDP packet\n"
call kernel_free