summaryrefslogtreecommitdiff
path: root/src/irc/dcc/dcc.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2003-07-09 23:34:41 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2003-07-09 23:34:41 +0000
commita619fe9a2ce6069edf15a3a53414fe0b17b4ac7a (patch)
tree94d68b583e3fa9bde08df08a993efac390e634bf /src/irc/dcc/dcc.c
parentae5b5f38bdd045df0a1dae78138b6b805dc934b1 (diff)
downloadirssi-a619fe9a2ce6069edf15a3a53414fe0b17b4ac7a.zip
Network fixes. DCC fixes for IPv6 + BSDs.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3124 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/dcc/dcc.c')
-rw-r--r--src/irc/dcc/dcc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c
index e3e04107..8bbca251 100644
--- a/src/irc/dcc/dcc.c
+++ b/src/irc/dcc/dcc.c
@@ -208,7 +208,10 @@ GIOChannel *dcc_listen(GIOChannel *iface, IPADDR *ip, int *port)
if (first == 0) {
/* random port */
*port = 0;
- return net_listen(NULL, port);
+ if (IPADDR_IS_V6(ip))
+ return net_listen(NULL, port);
+ else
+ return net_listen(&ip4_any, port);
}
/* get last port */
@@ -226,7 +229,10 @@ GIOChannel *dcc_listen(GIOChannel *iface, IPADDR *ip, int *port)
/* use the first available port */
for (*port = first; *port <= last; (*port)++) {
- handle = net_listen(NULL, port);
+ if (IPADDR_IS_V6(ip))
+ handle = net_listen(NULL, port);
+ else
+ handle = net_listen(&ip4_any, port);
if (handle != NULL)
return handle;
}