Although this is a very special case problem, I thought I would make this
patch available to anyone who wants it.
I run an internal DNS server on my home network, which causes the
DCC_USE_GATEWAY_ADDR switch to be completely useless to me. I really don't
want to have to disable internal DNS just to be able to send DCC, so I
made the following modifications to the source:
In vars.c:
I made DCC_USE_GATEWAY_ADDR a STR type var instead of a BOOL
In dcc.c:
Instead of on and off, There are three possibilities:
1. If the var is set to "0" or is NULL, then the default behavior happens
(local interface address)
2. If the var is set to "1", then the old "ON" behavior is used.
3. Otherwise, the value is assumed to be an IP address in "numbers and
dots" notation and inet_aton() is performed on that address and stored in
the myip struct.
In irc.c:
I modified the version line to show "+nullnode_dcc"
I hope this is helpful to anyone who has a similar problem with DCC.
Stephanie Rogerson <[EMAIL PROTECTED]>
nullnode on DALnet
--- dcc.c.orig Wed Mar 20 09:40:02 2002
+++ dcc.c Wed Mar 20 15:47:11 2002
@@ -724,10 +724,17 @@
char *type = dcc_types[dcc->flags & DCC_TYPES];
IA myip;
- if (get_int_var(DCC_USE_GATEWAY_ADDR_VAR))
+ /* To decide how to report our IP, look at DCC_USE_GATEWAY_ADDR
+ * If it is "0" or NULL use the local interface address
+ * "1" means to use the hostname from the servers rev lookup
+ * otherwise, make the value the IP address
+ */
+ if (!strcmp(get_string_var(DCC_USE_GATEWAY_ADDR_VAR),"1"))
myip.s_addr = get_server_uh_addr(from_server).s_addr;
- else
+ else if
+((!strcmp(get_string_var(DCC_USE_GATEWAY_ADDR_VAR),"0"))||(get_string_var(DCC_USE_GATEWAY_ADDR_VAR)
+ == NULL))
myip.s_addr = get_server_local_addr(from_server).s_addr;
+ else
+ inet_aton(get_string_var(DCC_USE_GATEWAY_ADDR_VAR),&myip);
/*
* If this is to be a 2-peer connection, then we need to
--- irc.c.orig Wed Mar 20 09:40:12 2002
+++ irc.c Wed Mar 20 15:55:08 2002
@@ -13,7 +13,7 @@
/*
* irc_version is what $J returns, its the common-name for the version.
*/
-const char irc_version[] = "EPIC4-1.1.3";
+const char irc_version[] = "EPIC4-1.1.3+nullnode_dcc";
const char useful_info[] = "epic4 1 1 3";
/*
--- vars.c.orig Wed Mar 20 09:39:37 2002
+++ vars.c Wed Mar 20 09:44:21 2002
@@ -122,7 +122,7 @@
{ "DCC_SLIDING_WINDOW", INT_TYPE_VAR, DEFAULT_DCC_SLIDING_WINDOW,
NULL, NULL, 0, 0 },
{ "DCC_STORE_PATH", STR_TYPE_VAR, 0, NULL, NULL, 0, 0 },
{ "DCC_TIMEOUT", INT_TYPE_VAR, DEFAULT_DCC_TIMEOUT, NULL,
set_dcc_timeout, 0, 0 },
- { "DCC_USE_GATEWAY_ADDR", BOOL_TYPE_VAR, 0, NULL, NULL, 0, 0 },
+ { "DCC_USE_GATEWAY_ADDR", STR_TYPE_VAR, 0, NULL, NULL, 0, 0 },
{ "DEBUG", INT_TYPE_VAR, 0, NULL, NULL, 0, 0 },
{ "DISPATCH_UNKNOWN_COMMANDS", BOOL_TYPE_VAR,
DEFAULT_DISPATCH_UNKNOWN_COMMANDS, NULL, NULL, 0, 0 },
{ "DISPLAY", BOOL_TYPE_VAR, DEFAULT_DISPLAY, NULL, NULL,
0, 0 },