aboutsummaryrefslogtreecommitdiffstats
path: root/lib/proxy.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-21 12:28:34 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-21 12:28:34 +0200
commit783e9b76de9a8ec16e8229d7c476b16ba8011554 (patch)
treeee27ef686f8aefa4dc36a3d0999e123f52ed0fb2 /lib/proxy.c
parent51bbec0b0e280be629f7b1086160b7730ebfdb74 (diff)
parent92998915be47eab17e548af5c3dd43fa4eab9683 (diff)
Merge trunk.
Diffstat (limited to 'lib/proxy.c')
-rw-r--r--lib/proxy.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/proxy.c b/lib/proxy.c
index 53b89d64..91493557 100644
--- a/lib/proxy.c
+++ b/lib/proxy.c
@@ -113,6 +113,7 @@ static gboolean gaim_io_connected(gpointer data, gint source, b_input_condition
static int proxy_connect_none(const char *host, unsigned short port, struct PHB *phb)
{
struct sockaddr_in *sin;
+ struct sockaddr_in me;
int fd = -1;
if (!(sin = gaim_gethostbyname(host, port))) {
@@ -127,6 +128,16 @@ static int proxy_connect_none(const char *host, unsigned short port, struct PHB
sock_make_nonblocking(fd);
+ if( global.conf->iface_out )
+ {
+ me.sin_family = AF_INET;
+ me.sin_port = 0;
+ me.sin_addr.s_addr = inet_addr( global.conf->iface_out );
+
+ if( bind( fd, (struct sockaddr *) &me, sizeof( me ) ) != 0 )
+ event_debug( "bind( %d, \"%s\" ) failure\n", fd, global.conf->iface_out );
+ }
+
event_debug("proxy_connect_none( \"%s\", %d ) = %d\n", host, port, fd);
if (connect(fd, (struct sockaddr *)sin, sizeof(*sin)) < 0 && !sockerr_again()) {