diff --git a/kernel/branches/net/network/socket.inc b/kernel/branches/net/network/socket.inc index da3abe0033..74bf4b3769 100644 --- a/kernel/branches/net/network/socket.inc +++ b/kernel/branches/net/network/socket.inc @@ -834,6 +834,20 @@ SOCKET_receive_dgram: .block: SOCKET_block eax, .loop, s_error +align 4 +SOCKET_receive_local: + + ; does this socket have a PID yet? + cmp [eax + SOCKET.PID], 0 + jne @f + + ; Change PID to that of current process + mov ebx, [TASK_BASE] + mov ebx, [ebx + TASKDATA.pid] + mov [eax + SOCKET.PID], ebx + @@: + + mov [eax + SOCKET.rcv_proc], SOCKET_receive_stream align 4 SOCKET_receive_stream: @@ -953,8 +967,6 @@ SOCKET_send_pppoe: align 4 SOCKET_send_local: - DEBUGF 1,"SOCKET_send: LOCAL\n" - ; does this socket have a PID yet? cmp [eax + SOCKET.PID], 0 jne @f @@ -964,6 +976,12 @@ SOCKET_send_local: mov ebx, [ebx + TASKDATA.pid] mov [eax + SOCKET.PID], ebx @@: + mov [eax + SOCKET.snd_proc], SOCKET_send_local_ + +align 4 +SOCKET_send_local_: + + DEBUGF 1,"SOCKET_send: LOCAL\n" ; get the other side's socket and check if it still exists mov eax, [eax + SOCKET.device] @@ -1133,7 +1151,7 @@ SOCKET_pair: mov [eax + SOCKET.Type], SOCK_STREAM mov [eax + SOCKET.Protocol], 0 ;;; CHECKME mov [eax + SOCKET.snd_proc], SOCKET_send_local - mov [eax + SOCKET.rcv_proc], SOCKET_receive_stream + mov [eax + SOCKET.rcv_proc], SOCKET_receive_local mov ebx, eax call SOCKET_alloc @@ -1144,7 +1162,7 @@ SOCKET_pair: mov [eax + SOCKET.Type], SOCK_STREAM mov [eax + SOCKET.Protocol], 0 ;;; CHECKME mov [eax + SOCKET.snd_proc], SOCKET_send_local - mov [eax + SOCKET.rcv_proc], SOCKET_receive_stream + mov [eax + SOCKET.rcv_proc], SOCKET_receive_local ; Link the two sockets to eachother mov [eax + SOCKET.device], ebx