summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes1
-rw-r--r--data/example.conf10
-rw-r--r--src/sessions.c15
-rw-r--r--version.log6
4 files changed, 25 insertions, 7 deletions
diff --git a/Changes b/Changes
index 0256752c6..773b578c9 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
Anope Version S V N
--------------------
+08/29 A Session limit exceptions now support IP numbers as hostmask [#723]
08/29 A Added InspIRCd11 vIdent support. [#684]
06/15 F Non-existing servers being SQUIT'd when they were juped. [#726]
06/15 F Back online notice being sent to juped servers. [#726]
diff --git a/data/example.conf b/data/example.conf
index ceac50923..dec63c400 100644
--- a/data/example.conf
+++ b/data/example.conf
@@ -1269,11 +1269,11 @@ WallDrop
# connecting more than a certain number of times from the same host at the
# same time - thus preventing most types of cloning. Once a host reaches
# it's session limit, all clients attempting to connect from that host
-# will be killed. Exceptions to the default session limit, which are based
-# on host names, can be defined via the exception list. It should be noted
-# that session limiting, along with a large exception list, can degrade
-# services' performance. See the source and comments in sessions.c and the
-# online help for more information about session limiting.
+# will be killed. Exceptions to the default session limit can be defined
+# via the exception list. It should be noted that session limiting, along
+# with a large exception list, can degrade services' performance.
+# See the source and comments in sessions.c and the online help for more
+# information about session limiting.
#
# NOTE: This option is not available when STREAMLINED is defined in
# the Makefile.
diff --git a/src/sessions.c b/src/sessions.c
index 88600e304..4b665e1bc 100644
--- a/src/sessions.c
+++ b/src/sessions.c
@@ -351,14 +351,27 @@ void expire_exceptions(void)
Exception *find_host_exception(const char *host)
{
+ char *ipbuf = NULL;
+ char *myhost = NULL;
int i;
+ /* we try to resolve the hostname to an IP in case
+ * the exception was added by IP instead of hostname - DrStein */
+ if (host)
+ myhost = sstrdup(host);
+ ipbuf = host_resolve(myhost);
+
for (i = 0; i < nexceptions; i++) {
- if (match_wild_nocase(exceptions[i].mask, host)) {
+ if ((match_wild_nocase(exceptions[i].mask, host))
+ || ((ipbuf != NULL)
+ && match_wild_nocase(exceptions[i].mask, ipbuf))) {
+ Anope_Free(myhost);
return &exceptions[i];
}
}
+ Anope_Free(myhost);
+
return NULL;
}
diff --git a/version.log b/version.log
index 8aa1f6c68..077e5c7f2 100644
--- a/version.log
+++ b/version.log
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="19"
VERSION_EXTRA="-svn"
-VERSION_BUILD="1289"
+VERSION_BUILD="1290"
# $Log$
#
+# BUILD : 1.7.19 (1290)
+# BUGS : 723
+# NOTES : Anope now can except users from Session limit based on their IP.
+#
# BUILD : 1.7.19 (1289)
# BUGS : 768
# NOTES : Fixed module runtime directory not always being cleaned up nicely