From da9d55f4032e2c3fbe2af5b8c61c559ea56fd383 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 22 May 2001 00:16:38 +0000 Subject: /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 --- src/irc/dcc/dcc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/irc/dcc/dcc.c') 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); -- cgit v1.2.3