+2002-04-12 Corinna Vinschen <corinna@vinschen.de>
+
+ * net.cc (cygwin_accept): Set socket type for accepted socket.
+ (socketpair): Set socket type for both sockets.
+
+2002-04-12 Egor Duda <deo@logos-m.ru>
+
+ * fhandler.h (class fhandler_socket): New member to store socket type.
+ (fhandler_socket::get_socket_type): Access it.
+ (fhandler_socket::set_socket_type): Ditto.
+ * net.cc (cygwin_socket): Store socket type.
+ (cygwin_connect): Disable security checks for connectionless sockets.
+ (cygwin_accept): Ditto.
+
2002-04-09 Mark Bradshaw <bradshaw@staff.crosswalk.com>
* cygwin.din: Add strptime.
{
private:
int addr_family;
+ int type;
int connect_secret [4];
HANDLE secret_event;
struct _WSAPROTOCOL_INFOA *prot_info_ptr;
select_record *select_except (select_record *s);
void set_addr_family (int af) {addr_family = af;}
int get_addr_family () {return addr_family;}
+ void set_socket_type (int st) { type = st;}
+ int get_socket_type () {return type;}
void set_sun_path (const char *path);
char *get_sun_path () {return sun_path;}
void set_connect_secret ();
{
int res = -1;
SOCKET soc = 0;
+ fhandler_socket* fh = NULL;
cygheap_fdnew fd;
else
name = (type == SOCK_STREAM ? "/dev/streamsocket" : "/dev/dgsocket");
- fdsock (fd, name, soc)->set_addr_family (af);
+ fh = fdsock (fd, name, soc);
+ if (fh)
+ {
+ fh->set_addr_family (af);
+ fh->set_socket_type (type);
+ }
res = fd;
}
}
set_winsock_errno ();
}
- if (sock->get_addr_family () == AF_LOCAL)
+ if (sock->get_addr_family () == AF_LOCAL &&
+ sock->get_socket_type () == SOCK_STREAM)
{
if (!res || in_progress)
{
WSAGetLastError () == WSAEWOULDBLOCK)
in_progress = TRUE;
- if (sock->get_addr_family () == AF_LOCAL)
+ if (sock->get_addr_family () == AF_LOCAL &&
+ sock->get_socket_type () == SOCK_STREAM)
{
if ((SOCKET) res != (SOCKET) INVALID_SOCKET || in_progress)
{
if (sock->get_addr_family () == AF_LOCAL)
res_fh->set_sun_path (sock->get_sun_path ());
res_fh->set_addr_family (sock->get_addr_family ());
+ res_fh->set_socket_type (sock->get_socket_type ());
res = res_fd;
}
}
struct sockaddr_in sock_in, sock_out;
int len;
cygheap_fdnew sb0;
+ fhandler_socket *fh;
if (__check_null_invalid_struct_errno (sb, 2 * sizeof(int)))
return -1;
if (family == AF_LOCAL)
{
- fhandler_socket *fh;
fh = fdsock (sb[0],
type == SOCK_STREAM ? "/dev/streamsocket" : "/dev/dgsocket",
insock);
fh->set_sun_path ("");
fh->set_addr_family (AF_LOCAL);
+ fh->set_socket_type (type);
fh = fdsock (sb[1],
type == SOCK_STREAM ? "/dev/streamsocket" : "/dev/dgsocket",
outsock);
fh->set_sun_path ("");
fh->set_addr_family (AF_LOCAL);
+ fh->set_socket_type (type);
}
else
{
- fdsock (sb[0], type == SOCK_STREAM ? "/dev/tcp" : "/dev/udp",
- insock)->set_addr_family (AF_INET);
- fdsock (sb[1], type == SOCK_STREAM ? "/dev/tcp" : "/dev/udp",
- outsock)->set_addr_family (AF_INET);
+ fh = fdsock (sb[0], type == SOCK_STREAM ? "/dev/tcp" : "/dev/udp",
+ insock);
+ fh->set_addr_family (AF_INET);
+ fh->set_socket_type (type);
+ fh = fdsock (sb[1], type == SOCK_STREAM ? "/dev/tcp" : "/dev/udp",
+ outsock);
+ fh->set_addr_family (AF_INET);
+ fh->set_socket_type (type);
}
done: