2929*/
3030
3131#include <winsock2.h>
32+ #include <afunix.h>
3233#include <ws2tcpip.h>
3334#include <mswsock.h>
3435#include <errno.h>
@@ -118,7 +119,7 @@ socketio_acceptEx(struct w32_io* pio)
118119 }
119120
120121 /* create accepting socket */
121- context -> accept_socket = socket (addr .ss_family , SOCK_STREAM , IPPROTO_TCP );
122+ context -> accept_socket = socket (addr .ss_family , SOCK_STREAM , IPPROTO_IP );
122123 if (context -> accept_socket == INVALID_SOCKET ) {
123124 errno = errno_from_WSALastError ();
124125 debug3 ("acceptEx - socket() ERROR:%d, io:%p" , WSAGetLastError (), pio );
@@ -756,7 +757,7 @@ socketio_accept(struct w32_io* pio, struct sockaddr* addr, int* addrlen)
756757int
757758socketio_connectex (struct w32_io * pio , const struct sockaddr * name , int namelen )
758759{
759-
760+ struct sockaddr_un tmp_unix ;
760761 struct sockaddr_in tmp_addr4 ;
761762 struct sockaddr_in6 tmp_addr6 ;
762763 SOCKADDR * tmp_addr ;
@@ -778,6 +779,11 @@ socketio_connectex(struct w32_io* pio, const struct sockaddr* name, int namelen)
778779 tmp_addr4 .sin_port = 0 ;
779780 tmp_addr = (SOCKADDR * )& tmp_addr4 ;
780781 tmp_addr_len = sizeof (tmp_addr4 );
782+ } else if (name -> sa_family == AF_UNIX ) {
783+ ZeroMemory (& tmp_unix , sizeof (tmp_unix ));
784+ tmp_unix .sun_family = AF_UNIX ;
785+ tmp_addr = (SOCKADDR * )& tmp_unix ;
786+ tmp_addr_len = sizeof (tmp_unix );
781787 } else {
782788 errno = ENOTSUP ;
783789 debug3 ("connectex - ERROR: unsuppored address family:%d, io:%p" , name -> sa_family , pio );
0 commit comments