summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2010-12-02 13:38:42 +0100
committerAlexander Barton <alex@barton.de>2010-12-02 13:38:42 +0100
commit60bb40d67a8d7c1e38a5d8ca2b7968cf08706008 (patch)
tree82b5162e5dbe12ee9efda52c80c00c5d67fb4fe9 /src
parent5da98ec389de2a6d671d270abba86c395e593537 (diff)
downloadngircd-60bb40d67a8d7c1e38a5d8ca2b7968cf08706008.tar.gz
ngircd-60bb40d67a8d7c1e38a5d8ca2b7968cf08706008.zip
Reset ID of outgoing server link on DNS error correctly
Not resetting the ID prevents the daemon from trying to re-establish
outgoing server links when the DNS resolver failed to resole a hostname.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/conn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 2d5e1295..a92f99f7 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -1968,8 +1968,11 @@ cb_Connect_to_Server(int fd, UNUSED short events)
 
 	/* Read result from pipe */
 	len = Proc_Read(&Conf_Server[i].res_stat, dest_addrs, sizeof(dest_addrs));
-	if (len == 0)
+	if (len == 0) {
+		/* Error resolving hostname: reset server structure */
+		Conf_Server[i].conn_id = NONE;
 		return;
+	}
 
 	assert((len % sizeof(ng_ipaddr_t)) == 0);