From 055f52f6ed8900a32af2a22ec83d3aeeba115a59 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Tue, 28 Jun 2005 00:42:06 +0000 Subject: [PATCH] Never count servers in IPcheck. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1438 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 8 ++++++++ ircd/s_bsd.c | 33 +++++++++++++++++++-------------- ircd/s_serv.c | 6 ------ 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d42b8d..6050fd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-06-27 Michael Poole + + * ircd/s_bsd.c (add_connection): Split logic for server versus + client listeners; only do IPcheck for client connections. + + * ircd/s_serv.c (server_estab): There is no longer a need to + remove IPcheck reference, so don't. + 2005-06-27 Michael Poole * include/client.h (struct Connection): Remove con_dns_reply (and diff --git a/ircd/s_bsd.c b/ircd/s_bsd.c index 27cdf30..2a57382 100644 --- a/ircd/s_bsd.c +++ b/ircd/s_bsd.c @@ -518,27 +518,32 @@ void add_connection(struct Listener* listener, int fd) { */ os_disable_options(fd); - /* - * Add this local client to the IPcheck registry. - * - * If they're throttled, murder them, but tell them why first. - */ - if (!IPcheck_local_connect(&addr.addr, &next_target) && !listener->server) + if (listener->server) { - ++ServerStats->is_ref; - write(fd, throttle_message, strlen(throttle_message)); - close(fd); - return; + new_client = make_client(0, STAT_UNKNOWN_SERVER); + } + else + { + /* + * Add this local client to the IPcheck registry. + * + * If they're throttled, murder them, but tell them why first. + */ + if (!IPcheck_local_connect(&addr.addr, &next_target)) + { + ++ServerStats->is_ref; + write(fd, throttle_message, strlen(throttle_message)); + close(fd); + return; + } + new_client = make_client(0, STAT_UNKNOWN_USER); + SetIPChecked(new_client); } - - new_client = make_client(0, ((listener->server) ? - STAT_UNKNOWN_SERVER : STAT_UNKNOWN_USER)); /* * Copy ascii address to 'sockhost' just in case. Then we have something * valid to put into error messages... */ - SetIPChecked(new_client); ircd_ntoa_r(cli_sock_ip(new_client), &addr.addr); strcpy(cli_sockhost(new_client), cli_sock_ip(new_client)); memcpy(&cli_ip(new_client), &addr.addr, sizeof(cli_ip(new_client))); diff --git a/ircd/s_serv.c b/ircd/s_serv.c index bc09198..abcf6aa 100644 --- a/ircd/s_serv.c +++ b/ircd/s_serv.c @@ -133,12 +133,6 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf) cli_serv(cptr)->timestamp, MAJOR_PROTOCOL, NumServCap(&me), feature_bool(FEAT_HUB) ? "h" : "", *(cli_info(&me)) ? cli_info(&me) : "IRCers United"); - /* - * Don't charge this IP# for connecting - * XXX - if this comes from a server port, it will not have been added - * to the IP check registry, see add_connection in s_bsd.c - */ - IPcheck_connect_fail(cptr); } det_confs_butmask(cptr, CONF_SERVER | CONF_UWORLD); -- 2.20.1