diff --git a/src/cfgfile.c b/src/cfgfile.c index 430d3829..8d0ee1cc 100644 --- a/src/cfgfile.c +++ b/src/cfgfile.c @@ -775,6 +775,10 @@ static void _parse_relay(xmlDocPtr doc, xmlNodePtr node, relay->on_demand = atoi(tmp); if (tmp) xmlFree(tmp); } + else if (xmlStrcmp (node->name, XMLSTR("bind")) == 0) { + if (relay->bind) xmlFree (relay->bind); + relay->bind = (char *)xmlNodeListGetString (doc, node->xmlChildrenNode, 1); + } } while ((node = node->next)); if (relay->localmount == NULL) relay->localmount = (char *)xmlStrdup (XMLSTR(relay->mount)); diff --git a/src/slave.c b/src/slave.c index dd69ce70..903c4b79 100644 --- a/src/slave.c +++ b/src/slave.c @@ -190,7 +190,7 @@ static client_t *open_relay_connection (relay_server *relay) INFO2 ("connecting to %s:%d", server, port); - streamsock = sock_connect_wto (server, port, 10); + streamsock = sock_connect_wto_bind (server, port, relay->bind, 10); if (streamsock == SOCK_ERROR) { WARN2 ("Failed to connect to %s:%d", server, port); diff --git a/src/slave.h b/src/slave.h index e5c2fdaf..470d6f4b 100644 --- a/src/slave.h +++ b/src/slave.h @@ -22,6 +22,7 @@ typedef struct _relay_server { char *username; char *password; char *localmount; + char *bind; struct source_tag *source; int mp3metadata; int on_demand;