1
0
mirror of https://github.com/irssi/irssi.git synced 2025-02-02 15:08:01 -05:00

net_listen() works now properly with --enable-ipv6 and a system that doesn't

have a working IPv6 support


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1382 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-03-14 22:26:00 +00:00 committed by cras
parent 1d453ed92c
commit adec7641f0

View File

@ -245,6 +245,15 @@ GIOChannel *net_listen(IPADDR *my_ip, int *port)
/* create the socket */
handle = socket(so.sin.sin_family, SOCK_STREAM, 0);
#ifdef HAVE_IPV6
if (handle == -1 && errno == EINVAL) {
/* IPv6 is not supported by OS */
so.sin.sin_family = AF_INET;
so.sin.sin_addr.s_addr = INADDR_ANY;
handle = socket(AF_INET, SOCK_STREAM, 0);
}
#endif
if (handle == -1)
return NULL;