From f3351f0ae5c6014e36e529684b81e78cad9a66ce Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 5 Apr 2008 12:54:31 +0100 Subject: Fixed GLib <2.6 compatibility issue in arc.h. (G_GNUC_MALLOC) --- lib/arc.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/arc.h b/lib/arc.h index 58f30d3d..816fa612 100644 --- a/lib/arc.h +++ b/lib/arc.h @@ -30,6 +30,10 @@ struct arc_state unsigned char i, j; }; +#ifndef G_GNUC_MALLOC +#define G_GNUC_MALLOC +#endif + G_GNUC_MALLOC struct arc_state *arc_keymaker( unsigned char *key, int kl, int cycles ); unsigned char arc_getbyte( struct arc_state *st ); int arc_encode( char *clear, int clear_len, unsigned char **crypt, char *password, int pad_to ); -- cgit v1.2.3 From aefaac3a5d44537bdf804d1f42e491cc2b931889 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 6 Apr 2008 16:34:25 +0100 Subject: Added ClientInterface configuration option to make BitlBee bind() to a specific interface before connecting to a remote host. --- lib/proxy.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib') 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()) { -- cgit v1.2.3