/CONNECT, /SERVER: added -4 and -6 options for specifying if we should

connect to IPv4 or IPv6 address of the server. If -host or /SET
hostname is set irssi determines from it if it should use IPv4 or v6.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1192 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-02-09 21:26:50 +00:00 committed by cras
commit 8938a0f42b
8 changed files with 39 additions and 22 deletions

View file

@ -42,7 +42,7 @@ static void get_source_host_ip(void)
/* FIXME: This will block! */
source_host_ok = *settings_get_str("hostname") != '\0' &&
net_gethostbyname(settings_get_str("hostname"), &ip) == 0;
net_gethostbyname(settings_get_str("hostname"), &ip, 0) == 0;
if (source_host_ok) {
if (source_host_ip == NULL)
source_host_ip = g_new(IPADDR, 1);
@ -65,7 +65,7 @@ static void conn_set_ip(SERVER_CONNECT_REC *conn,
/* resolve the IP and use it */
if (net_gethostbyname(own_host, &ip) == 0) {
if (net_gethostbyname(own_host, &ip, conn->family) == 0) {
if (conn->own_ip == NULL)
conn->own_ip = g_new(IPADDR, 1);
memcpy(conn->own_ip, &ip, sizeof(IPADDR));