Commit Graph

17 Commits

Author SHA1 Message Date
Kevin Easton
176be1cff2 Add the ability to bind listening sockets to addresses, and use this for the
/detach IPC socket.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@330 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-15 14:05:15 +00:00
Kevin Easton
338a8ecd4c Remove unnecessary declarations in term.c for wserv builds.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@312 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-12 09:40:59 +00:00
Tim Cava
37dcaad1ae Make the addrlen passed to connect() in connect_by_number() a socklen_t.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@281 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 04:16:13 +00:00
Tim Cava
e070369079 Make the namelen passed to getsockname() a socklen_t everywhere.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@280 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 03:26:00 +00:00
Tim Cava
a3b938dfd5 Make the addrlen argument to my_accept() a socklen_t.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@277 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 02:59:11 +00:00
Kevin Easton
2fc84d5f93 Fix a file descriptor leak when connect() fails during a SOCKS4 proxy
connection attempt.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@242 13b04d17-f746-0410-82c6-800466cd88b0
2013-06-18 11:00:12 +00:00
Kevin Easton
252d1bf004 On systems that support it, supply the AI_ADDRCONFIG flag to getaddrinfo().
This means that we shouldn't try to connect using IPv6 if the local machine
doesn't have an IPv6 address itself.

This also simplifies the IPv6 code in BX_connect_by_number() a bit.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@203 13b04d17-f746-0410-82c6-800466cd88b0
2012-06-02 11:38:37 +00:00
Kevin Easton
ab7d59f1f6 Add a length sanity check - just in case there's an implementation out there
that parses AF_UNIX addresses in getaddrinfo() or something.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@189 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-15 14:01:42 +00:00
Kevin Easton
ba365bfd54 Fix logic error that can result in a potential crash (when getaddrinfo() fails
and res happened to be NULL).

Also add missing freeaddrinfo() call.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@188 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-15 13:29:32 +00:00
Kevin Easton
26a62fe7fa Rework the IPV6 verison of BX_ip_to_host() so that it works on BSD (used
by $iptoname() scripting function).


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@182 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-14 13:56:52 +00:00
Kevin Easton
f035eceb72 Pass the right socket address length to bind() in client connections with
IPv6 enabled.  This fixes an issue reported by packet, where IPv4 conections
don't work on FreeBSD when the client is built with IPv6 support and you
have a local hostname set (with /hostname, -H or IRCHOST).

Also ensure we clear the full size of the 'server' address structure - doesn't
fix a known problem but is a defensive measure.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@181 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-13 14:06:53 +00:00
Kevin Easton
5d788560a4 Choose the address length passed to connect() based on the address family.
This fixes making IPv4 connections on BSD when the client is compiled with
IPv6 enabled.

Thanks to brabes on sourceforge and snadge@freenode for originally tracking
this down.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@176 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-11 12:22:03 +00:00
Kevin Easton
0219904860 Ensure that real errors from connect() (eg. EINVAL) are detected and
acted on immmediately, even for nonblocking connects.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@175 13b04d17-f746-0410-82c6-800466cd88b0
2012-05-11 12:03:10 +00:00
Kevin Easton
3090365354 Change connect_by_number() so that SERVICE_SERVER sockets are always bound to
IPv4 even on an IPv6-enabled client.  This fixes /detach and wserv when
compiling with --enable-ipv6.

This does also mean that the internal identd, if used, won't listen on IPv6
either.  This isn't a problem yet, since the internal identd is used only on
WINNT and we don't support IPv6 there yet.

This will also need tweaking to support initiating DCC-over-IPv6.

Thanks to snadge and packet for working on this bug.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@162 13b04d17-f746-0410-82c6-800466cd88b0
2012-04-29 12:15:57 +00:00
Kevin Easton
6711ef7f00 Correct use of IN6ADDR_ANY_INIT initialiser, fixes IPv6 build on Intel ICC.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@105 13b04d17-f746-0410-82c6-800466cd88b0
2010-12-16 21:15:15 +00:00
Kevin Easton
533c3dbcbf Turn on SVN keyword replacement for $Date$, $Author$, $Revision$, $Id$ for all
*.c and *.h files.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/branches/ircii-pana-1.1@3 13b04d17-f746-0410-82c6-800466cd88b0
2008-02-25 09:49:14 +00:00
Kevin Easton
28febcfea9 Initial import of the ircii-pana-1.1-final source tree.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
2008-02-25 09:25:32 +00:00