diff --git a/kernel/trunk/network/socket.inc b/kernel/trunk/network/socket.inc index 29002197b3..d5f09dd698 100644 --- a/kernel/trunk/network/socket.inc +++ b/kernel/trunk/network/socket.inc @@ -169,6 +169,15 @@ struct STREAM_SOCKET TCP_SOCKET ends +struct sockaddr + + family dw ? ; Address family + port dw ? ; 16 bit TCP/UDP port number + ip dd ? ; 32 bit IP address + _zero rb 8 ; Not use, for align + +ends + struct socket_queue_entry data_ptr dd ? diff --git a/kernel/trunk/network/udp.inc b/kernel/trunk/network/udp.inc index 8741e2d40d..e64a9db566 100644 --- a/kernel/trunk/network/udp.inc +++ b/kernel/trunk/network/udp.inc @@ -305,6 +305,7 @@ udp_output: ; udp_connect ; ; ; ; IN: eax = socket pointer ; +; edx = pointer to sockaddr struct ; ; ; ; OUT: eax = 0 on success ; ; eax = -1 on error ; @@ -325,10 +326,10 @@ udp_connect: pop edx eax ; Fill in remote port and IP - pushw [edx + 2] - pop [eax + UDP_SOCKET.RemotePort] + pushw [edx + sockaddr.port] + popw [eax + UDP_SOCKET.RemotePort] - pushd [edx + 4] + pushd [edx + sockaddr.ip] pop [eax + UDP_SOCKET.RemoteIP] ; Find route to host