]> granicus.if.org Git - ngircd/commitdiff
Fix connect attempts to further IP addresses of outgoing server links
authorAlexander Barton <alex@barton.de>
Wed, 27 Oct 2010 19:59:51 +0000 (21:59 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 27 Oct 2010 19:59:51 +0000 (21:59 +0200)
If a hostname resolves to more than one IP address (round-robin DNS,
IPv4 and IPv6) and an attempt to connect to the first address fails,
ngIRCd should try to connect to the 2nd address, 3rd address etc.

But because of a wrong variable used in the call to New_Server(),
the wrong server structure has been used in further connection attemps
which possibly lead to connection attempts to already connected servers.

src/ngircd/conn.c

index bbb186e9b19d60186593db1084e8d6a5d88fede0..2d5e1295f4341b1675db274f0263f66fda92b3f8 100644 (file)
@@ -207,7 +207,7 @@ cb_connserver(int sock, UNUSED short what)
 
                if (ng_ipaddr_af(&Conf_Server[server].dst_addr[0])) {
                        /* more addresses to try... */
-                       New_Server(res, &Conf_Server[server].dst_addr[0]);
+                       New_Server(server, &Conf_Server[server].dst_addr[0]);
                        /* connection to dst_addr[0] is now in progress, so
                         * remove this address... */
                        Conf_Server[server].dst_addr[0] =