29
29
*/
30
30
31
31
#include <winsock2.h>
32
+ #include <afunix.h>
32
33
#include <ws2tcpip.h>
33
34
#include <mswsock.h>
34
35
#include <errno.h>
@@ -118,7 +119,7 @@ socketio_acceptEx(struct w32_io* pio)
118
119
}
119
120
120
121
/* 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 );
122
123
if (context -> accept_socket == INVALID_SOCKET ) {
123
124
errno = errno_from_WSALastError ();
124
125
debug3 ("acceptEx - socket() ERROR:%d, io:%p" , WSAGetLastError (), pio );
@@ -756,7 +757,7 @@ socketio_accept(struct w32_io* pio, struct sockaddr* addr, int* addrlen)
756
757
int
757
758
socketio_connectex (struct w32_io * pio , const struct sockaddr * name , int namelen )
758
759
{
759
-
760
+ struct sockaddr_un tmp_unix ;
760
761
struct sockaddr_in tmp_addr4 ;
761
762
struct sockaddr_in6 tmp_addr6 ;
762
763
SOCKADDR * tmp_addr ;
@@ -778,6 +779,11 @@ socketio_connectex(struct w32_io* pio, const struct sockaddr* name, int namelen)
778
779
tmp_addr4 .sin_port = 0 ;
779
780
tmp_addr = (SOCKADDR * )& tmp_addr4 ;
780
781
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 );
781
787
} else {
782
788
errno = ENOTSUP ;
783
789
debug3 ("connectex - ERROR: unsuppored address family:%d, io:%p" , name -> sa_family , pio );
0 commit comments