Bugfix for ICMP sockets in net branch

git-svn-id: svn://kolibrios.org@2553 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2012-04-03 16:34:37 +00:00
parent 318faf9264
commit b326834b2e
2 changed files with 12 additions and 12 deletions

View File

@ -202,7 +202,7 @@ align 4
IPv4_input: ; TODO: implement handler for IP options
; TODO2: add code for raw sockets
DEBUGF 1,"IPv4_Handler, packet from: %u.%u.%u.%u ",\
DEBUGF 1,"IPv4_input, packet from: %u.%u.%u.%u ",\
[edx + IPv4_header.SourceAddress]:1,[edx + IPv4_header.SourceAddress + 1]:1,[edx + IPv4_header.SourceAddress + 2]:1,[edx + IPv4_header.SourceAddress + 3]:1
DEBUGF 1,"to: %u.%u.%u.%u\n",\
[edx + IPv4_header.DestinationAddress]:1,[edx + IPv4_header.DestinationAddress + 1]:1,[edx + IPv4_header.DestinationAddress + 2]:1,[edx + IPv4_header.DestinationAddress + 3]:1
@ -595,7 +595,7 @@ IPv4_find_fragment_slot:
align 4
IPv4_output:
DEBUGF 1,"IPv4_create_packet: size=%u\n", ecx
DEBUGF 1,"IPv4_output: size=%u\n", ecx
cmp ecx, 65500 ; Max IPv4 packet size
ja .too_large
@ -649,7 +649,7 @@ IPv4_output:
.arp_error:
add esp, 4+4+4+2+2
.too_large:
DEBUGF 1,"IPv4_create_packet: Failed\n"
DEBUGF 1,"IPv4_output: Failed\n"
sub edi, edi
ret

View File

@ -227,24 +227,24 @@ ICMP_input:
; Look for an open ICMP socket
mov esi, [edi] ; ipv4 source address
mov ebx, net_sockets
mov eax, net_sockets
.try_more:
; mov ax , [edx + ICMP_header.Identifier]
; mov , [edx + ICMP_header.Identifier]
.next_socket:
mov ebx, [ebx + SOCKET.NextPtr]
or ebx, ebx
mov eax, [eax + SOCKET.NextPtr]
or eax, eax
jz .dump
cmp [ebx + SOCKET.Domain], AF_INET4
cmp [eax + SOCKET.Domain], AF_INET4
jne .next_socket
cmp [ebx + SOCKET.Protocol], IP_PROTO_ICMP
cmp [eax + SOCKET.Protocol], IP_PROTO_ICMP
jne .next_socket
cmp [ebx + IP_SOCKET.RemoteIP], esi
cmp [eax + IP_SOCKET.RemoteIP], esi
jne .next_socket
; cmp [esi + ICMP_SOCKET.Identifier], ax
; cmp [eax + ICMP_SOCKET.Identifier],
; jne .next_socket
; call IPv4_dest_to_dev
@ -252,7 +252,7 @@ ICMP_input:
; je .dump
; inc [ICMP_PACKETS_RX+edi]
DEBUGF 1,"Found valid ICMP packet for socket %x\n", ebx
DEBUGF 1,"Found valid ICMP packet for socket %x\n", eax
pusha
lea ecx, [eax + SOCKET.mutex]