summaryrefslogtreecommitdiff
path: root/src/irc/dcc/dcc.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-05-22 00:16:38 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-05-22 00:16:38 +0000
commitda9d55f4032e2c3fbe2af5b8c61c559ea56fd383 (patch)
treea38391bd279ccc76a25980b4dcb85bce5c4abbf5 /src/irc/dcc/dcc.c
parent62dc0e36eba4afb94821aef68ebe84019ed55797 (diff)
downloadirssi-da9d55f4032e2c3fbe2af5b8c61c559ea56fd383.zip
/SET dcc_own_ip for specifying own IP to use in DCC requests
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1512 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/dcc/dcc.c')
-rw-r--r--src/irc/dcc/dcc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c
index c0d87a07..16c35be0 100644
--- a/src/irc/dcc/dcc.c
+++ b/src/irc/dcc/dcc.c
@@ -152,8 +152,15 @@ DCC_REC *dcc_find_request(int type, const char *nick, const char *arg)
void dcc_ip2str(IPADDR *ip, char *host)
{
+ IPADDR temp_ip;
unsigned long addr;
+ if (*settings_get_str("dcc_own_ip") != '\0') {
+ /* overridden IP address */
+ net_host2ip(settings_get_str("dcc_own_ip"), &temp_ip);
+ ip = &temp_ip;
+ }
+
if (IPADDR_IS_V6(ip)) {
/* IPv6 */
net_ip2host(ip, host);
@@ -420,6 +427,7 @@ void irc_dcc_init(void)
settings_add_int("dcc", "dcc_port", 0);
settings_add_int("dcc", "dcc_timeout", 300);
+ settings_add_str("dcc", "dcc_own_ip", "");
signal_add("server connected", (SIGNAL_FUNC) sig_server_connected);
signal_add("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);