From 0ffb810660845caa183339cc48ffa304dd50c887 Mon Sep 17 00:00:00 2001 From: JD Horelick Date: Mon, 5 Apr 2010 15:28:44 -0400 Subject: [PATCH] Add a configuration option for ident_timeout. --- doc/example.conf | 1 + doc/reference.conf | 5 +++++ include/s_conf.h | 1 + modules/m_info.c | 6 ++++++ src/ircd.c | 5 ++++- src/newconf.c | 1 + src/s_conf.c | 1 + 7 files changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/example.conf b/doc/example.conf index 4848ed04..ca0d9abf 100755 --- a/doc/example.conf +++ b/doc/example.conf @@ -475,6 +475,7 @@ general { short_motd = no; ping_cookie = no; connect_timeout = 30 seconds; + ident_timeout = 5; disable_auth = no; no_oper_flood = yes; max_targets = 4; diff --git a/doc/reference.conf b/doc/reference.conf index d71cd0b0..69afcacd 100755 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -1116,6 +1116,11 @@ general { */ connect_timeout = 30 seconds; + /* ident timeout: Amount of time (in seconds) that the IRCd will + * wait for a user to respond to an ident request. + */ + ident_timeout = 5; + /* disable auth: disables identd checking */ disable_auth = no; diff --git a/include/s_conf.h b/include/s_conf.h index b1124f0b..d1736a47 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -206,6 +206,7 @@ struct config_file_entry int min_nonwildcard_simple; int default_floodcount; int client_flood; + int ident_timeout; int use_egd; int ping_cookie; int tkline_expire_notices; diff --git a/modules/m_info.c b/modules/m_info.c index 3cdd7ba4..6569dc84 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -133,6 +133,12 @@ static struct InfoStruct info_table[] = { &ConfigFileEntry.connect_timeout, "Connect timeout for connections to servers" }, + { + "ident_timeout", + OUTPUT_DECIMAL, + &ConfigFileEntry.ident_timeout, + "Amount of time the server waits for ident responses from clients", + }, { "default_floodcount", OUTPUT_DECIMAL, diff --git a/src/ircd.c b/src/ircd.c index a9f6cfbd..add5f65b 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -324,7 +324,10 @@ initialize_global_set_options(void) splitchecking = 1; } - GlobalSetOptions.ident_timeout = IDENT_TIMEOUT; + if(ConfigFileEntry.ident_timeout) + GlobalSetOptions.ident_timeout = ConfigFileEntry.ident_timeout; + else + GlobalSetOptions.ident_timeout = IDENT_TIMEOUT; rb_strlcpy(GlobalSetOptions.operstring, ConfigFileEntry.default_operstring, diff --git a/src/newconf.c b/src/newconf.c index 307d0890..b02beece 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -2136,6 +2136,7 @@ static struct ConfEntry conf_general_table[] = { "collision_fnc", CF_YESNO, NULL, 0, &ConfigFileEntry.collision_fnc }, { "connect_timeout", CF_TIME, NULL, 0, &ConfigFileEntry.connect_timeout }, { "default_floodcount", CF_INT, NULL, 0, &ConfigFileEntry.default_floodcount }, + { "ident_timeout", CF_INT, NULL, 0, &ConfigFileEntry.ident_timeout }, { "disable_auth", CF_YESNO, NULL, 0, &ConfigFileEntry.disable_auth }, { "dots_in_ident", CF_INT, NULL, 0, &ConfigFileEntry.dots_in_ident }, { "failed_oper_notice", CF_YESNO, NULL, 0, &ConfigFileEntry.failed_oper_notice }, diff --git a/src/s_conf.c b/src/s_conf.c index dc733430..1bc1bda2 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -782,6 +782,7 @@ set_default_conf(void) ConfigFileEntry.min_nonwildcard = 4; ConfigFileEntry.min_nonwildcard_simple = 3; ConfigFileEntry.default_floodcount = 8; + ConfigFileEntry.ident_timeout = 5; ConfigFileEntry.client_flood = CLIENT_FLOOD_DEFAULT; ConfigFileEntry.tkline_expire_notices = 0;