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 |