mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
net_listen(): when socket() failed because we tried to use IPv6, we should
have falled back to IPv4, but wrong errno was checked. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2248 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
740ab0d550
commit
26d9da61c8
@ -249,7 +249,7 @@ GIOChannel *net_listen(IPADDR *my_ip, int *port)
|
|||||||
/* create the socket */
|
/* create the socket */
|
||||||
handle = socket(so.sin.sin_family, SOCK_STREAM, 0);
|
handle = socket(so.sin.sin_family, SOCK_STREAM, 0);
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
if (handle == -1 && (errno == EINVAL || errno == EPROTONOSUPPORT)) {
|
if (handle == -1 && (errno == EINVAL || errno == EAFNOSUPPORT)) {
|
||||||
/* IPv6 is not supported by OS */
|
/* IPv6 is not supported by OS */
|
||||||
so.sin.sin_family = AF_INET;
|
so.sin.sin_family = AF_INET;
|
||||||
so.sin.sin_addr.s_addr = INADDR_ANY;
|
so.sin.sin_addr.s_addr = INADDR_ANY;
|
||||||
|
Loading…
Reference in New Issue
Block a user