THIS IS 7.10
authorArt Cancro <ajc@citadel.org>
Thu, 7 Jun 2007 18:43:23 +0000 (18:43 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 7 Jun 2007 18:43:23 +0000 (18:43 +0000)
citadel/clientsocket.c

index 4ac1963d9c705e891c3fe9f6034fa01f0c03a5cc..83f06ad6cd44cefa7d5b21865e3ffff34c45178b 100644 (file)
@@ -89,7 +89,9 @@ int sock_connect(char *host, char *service, char *protocol)
                return(-1);
        }
 
-       /* Set the outbound interface for egress */
+       /* If citserver is bound to a specific IP address on the host, make
+        * sure we use that address for outbound connections.
+        */
        memset(&egress_sin, 0, sizeof(egress_sin));
        egress_sin.sin_family = AF_INET;
        if (strlen(config.c_ip_addr) > 0) {
@@ -98,10 +100,11 @@ int sock_connect(char *host, char *service, char *protocol)
                        egress_sin.sin_addr.s_addr = INADDR_ANY;
                }
 
-               /* If this bind fails, no problem; we can still egress from the default interface */
+               /* If this bind fails, no problem; we can still use INADDR_ANY */
                bind(s, (struct sockaddr *)&egress_sin, sizeof(egress_sin));
         }
 
+       /* Now try to connect to the remote host. */
        if (connect(s, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
                lprintf(CTDL_ERR, "Can't connect to %s:%s: %s\n",
                        host, service, strerror(errno));