From b326834b2e17b0e62c969228ffed546aa59a9527 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Tue, 3 Apr 2012 16:34:37 +0000 Subject: [PATCH] Bugfix for ICMP sockets in net branch git-svn-id: svn://kolibrios.org@2553 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/network/IPv4.inc | 6 +++--- kernel/branches/net/network/icmp.inc | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/kernel/branches/net/network/IPv4.inc b/kernel/branches/net/network/IPv4.inc index f5ca25dbb1..01f7fbfdf0 100644 --- a/kernel/branches/net/network/IPv4.inc +++ b/kernel/branches/net/network/IPv4.inc @@ -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 diff --git a/kernel/branches/net/network/icmp.inc b/kernel/branches/net/network/icmp.inc index 736bdc0fbd..75988923fe 100644 --- a/kernel/branches/net/network/icmp.inc +++ b/kernel/branches/net/network/icmp.inc @@ -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]