diff options
author | drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2007-08-29 21:45:06 +0000 |
---|---|---|
committer | drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2007-08-29 21:45:06 +0000 |
commit | cc15db0a4428bd41218fd1870529b87df1aafb31 (patch) | |
tree | 021d519aca74546b56a44464194cf449cc93dd14 /src | |
parent | 3c1a2fbfca39b47e2f6df7862e7c83fe9f49f1c9 (diff) |
BUILD : 1.7.19 (1290) BUGS : 723 NOTES : Anope now can except users from Session limit based on their IP.
git-svn-id: svn://svn.anope.org/anope/trunk@1290 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1008 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/sessions.c | 15 |
1 files changed, 14 insertions, 1 deletions
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; } |