From 2ea2a7d64e158dfccb3e90a6b6d45647eed7323e Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 5 Jun 2007 20:47:43 +0000 Subject: [PATCH] When config.c_ip_addr is set, use that IP address not only for listening sockets, but also client sockets. This will allow outbound email to be sourced from the correct IP address when multiple unrelated Citadels are running on the same server. --- citadel/clientsocket.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/citadel/clientsocket.c b/citadel/clientsocket.c index c2f992ed7..1fffa2bdc 100644 --- a/citadel/clientsocket.c +++ b/citadel/clientsocket.c @@ -30,7 +30,8 @@ #include "snprintf.h" #endif #include "sysdep_decls.h" -#include +#include "config.h" +#include "clientsocket.h" #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff @@ -53,6 +54,9 @@ int sock_connect(char *host, char *service, char *protocol) memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; + if (strlen(config.c_ip_addr) > 0) { + sin.sin_addr.s_addr = inet_addr(config.c_ip_addr); + } pse = getservbyname(service, protocol); if (pse) { -- 2.39.2