summaryrefslogtreecommitdiff
path: root/src/core/network.c
AgeCommit message (Collapse)Author
2017-10-23Merge pull request #770 from horgh/horgh/rm-unused-functionailin-nemui
Remove a couple unused functions
2017-10-13Revert "Delete unused function net_ip_compare()"Will Storey
This reverts commit cb5f3cba1f2b5dbad67bcc107f3fe4a1875cc52d.
2017-10-10Always initialize the host stringWill Storey
This also removes a wordy comment
2017-10-09Delete unused function net_connect()Will Storey
2017-10-09Delete commented out CYGWIN defineWill Storey
2017-10-09Delete unused function net_ip_compare()Will Storey
2017-10-09Set host to an empty string on errorWill Storey
While investigating #317, I noticed that it was possible we would access an uninitialized buffer due to failing to check the return value of net_ip2host(). This is done in several places. To make such uses safe, set the host buffer to an empty string on error. It is possible callers could be improved by handling the error in each spot, but this gives us some safety.
2017-07-29Working /log and /rawlog.Edward Tomasz Napierala
Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
2017-07-29Fix warnings.Edward Tomasz Napierala
Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
2017-07-29Make DNS work in capability mode.Edward Tomasz Napierala
Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
2017-07-29/connect works - although only with IP addresses.Edward Tomasz Napierala
2016-04-07net_gethosterror: Handle EAI_SYSTEM ("System error") properlydequis
That error code means "check errno". A few users got it and we never figured out what happened - it usually fixed itself after restarting something - so hopefully with this we'll have more information the next time.
2016-02-03Merge pull request #410 from LemonBoy/getaddrinfo-v6-flagailin-nemui
Getaddrinfo v6 flag
2016-01-27Add AI_ADDRCONFIG to the getaddrinfo hints.LemonBoy
A first step to untangle the ipv4 vs ipv6 mess. At the time of writing Linux, OpenBSD and FreeBSD all support the AI_ADDRCONFIG flag.
2016-01-27Call getnameinfo with NI_NAMEREQD flag.LemonBoy
This way net_gethostbyaddr will fail when the system is unable to resolve the address to a valid host name. Without this flag in case of failure the function would return the ip address instead of failing.
2016-01-27Minor style fix in net_ip2host.LemonBoy
2016-01-27Delete the HAVE_IPV6 ifdef.LemonBoy
Welcome to the future.
2015-12-09Remove all WIN32 ifdefs (unifdef -UWIN32)dequis
Just use cygwin. This looks like it wasn't enough to do anything useful, and I don't think anyone cares about supporting win32 the hard way.
2015-09-22Revert "Network and IPv{4,6} related changes"ailin-nemui
2015-09-21Initial work to make irssi respect the resolved ip orderLemonBoy
Ip's aren't selected using random() anymore, also select the ip version by using getaddrinfo and some proper hints.
2014-11-08typo fixes - https://github.com/vlajos/misspell_fixerVeres Lajos
2014-07-06Initialize in6 correctlyDavid Leadbeater
This is technically wrong as it then gets used as an IPv4 sockaddr, but it only needs to be some 0s so this is easier than changing the IPADDR data structure or adding a new API.
2014-07-06Make configure checks able to build with -WerrorDavid Leadbeater
Also fix a few compiler warnings, this combined with pull #82 allows me to build with CFLAGS="-Werror -Wall".
2014-06-20Fix compiler warning.David Hill
network.c:63:2: warning: missing braces around initializer [-Wmissing-braces] network.c:63:2: warning: (near initialization for 'ip4_any.ip.__u6_addr') [-Wmissing-braces]
2014-06-15Replace deprecated g_io_channel_close with g_io_channel_shutdown.David Hill
g_io_channel_close flushes the buffer and does not return errors. g_io_channel_shutdown(handle, TRUE, NULL) keeps that behavior.
2014-01-10- Applied a patch from Jaroslav Škarvada (FTBFS if ↵Geert Hauwaerts
"-Werror=format-security" flag is used | https://bugzilla.redhat.com/show_bug.cgi?id=1037139) git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5229 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-05-16Fix segfault generated by SSL disconnections. (Bug #752)Jase Thew
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5170 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-04-03glib iochannel fixes from exg.Alexander Færøy
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5137 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-02-28Remove unused variable.Emanuele Giaquinta
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5028 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-11-20Remove unneeded casts.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4647 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-06-10Removed special error==1 handling from net_gethosterror(). It wasn't usedTimo Sirainen
anymore, and even when it originally was used it was wrong. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4551 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08Oops. Update address correctly now.Wouter Coekaerts
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4490 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08Update FSF addressWouter Coekaerts
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4489 dbcabf3a-b0e7-0310-adc4-f8d773084564
2006-03-26Removed all srand calls and added a single srand invokation in at startupJochen Eisinger
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4264 dbcabf3a-b0e7-0310-adc4-f8d773084564
2006-03-25prefixed all calls to rand() with a call to srand(time(NULL)), so we getJochen Eisinger
halfway random behaviour. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4263 dbcabf3a-b0e7-0310-adc4-f8d773084564
2005-11-19When looking up IP addresses, return random IP instead of the first one.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4077 dbcabf3a-b0e7-0310-adc4-f8d773084564
2005-10-15Remove the inline declarations, patch by nailbiterValentin Batz
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4040 dbcabf3a-b0e7-0310-adc4-f8d773084564
2004-01-28EAI_NODATA is depricated and doesn't exist everywhere anymoreTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3224 dbcabf3a-b0e7-0310-adc4-f8d773084564
2003-10-11unsigned long -> gsizeTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3131 dbcabf3a-b0e7-0310-adc4-f8d773084564
2003-10-0664bit fixes by Stefan FentTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3129 dbcabf3a-b0e7-0310-adc4-f8d773084564
2003-07-09Network fixes. DCC fixes for IPv6 + BSDs.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3124 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-12-10Compiler warning fixTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3054 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-11-29and remove outdated comment :)Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3033 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-11-29If bind() fails when connecting, don't fallback to default address. ShouldTimo Sirainen
make it easier to notice invalid settings or figure out why it's not working.. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3032 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-11-28net_gethostbyaddr() was pretty much broken.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3031 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-08-26removed the stupid error-parameters from net_connect*() calls. errno can beTimo Sirainen
used just fine. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2889 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-05-26net_ip2host() and net_host2ip() now treat any IPv6 IPs as 0.0.0.0, if IPv6Timo Sirainen
support isn't enabled in irssi. Also DCC's human readable IP address is taken from DCC SEND request directly with IPv6. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2825 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-05-19net_connect*() contains now error parameter, so it can be used to properlyTimo Sirainen
check the errno if connect() fails. Added support for connecting to named UNIX sockets. Some cleanups with session handling / server connecting as well. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2819 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-02-18if gethostbyname() failed, the return value was returned incorrectlyTimo Sirainen
(accidentally cvs committed it after some of my test) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2516 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-02-17still one isxdigit() -> i_isxdigit()Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2510 dbcabf3a-b0e7-0310-adc4-f8d773084564