summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 35a208be9..42294412b 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -559,6 +559,15 @@ bool DoConnect(ServerConfig* conf, const char*, char**, ValueList &values, int*)
{
if (*allow)
{
+ /* Find existing class by mask, the mask should be unique */
+ for (ClassVector::iterator item = conf->Classes.begin(); item != conf->Classes.end(); ++item)
+ {
+ if ((*item)->GetHost() == allow)
+ {
+ (*item)->Update(timeout, flood, allow, pingfreq, password, threshold, sendq, recvq, localmax, globalmax, maxchans, port, limit);
+ return true;
+ }
+ }
ConnectClass* cc = new ConnectClass(name, timeout, flood, allow, pingfreq, password, hashtype, threshold, sendq, recvq, localmax, globalmax, maxchans);
cc->limit = limit;
cc->SetPort(port);
@@ -566,6 +575,16 @@ bool DoConnect(ServerConfig* conf, const char*, char**, ValueList &values, int*)
}
else
{
+ /* Find existing class by mask, the mask should be unique */
+ for (ClassVector::iterator item = conf->Classes.begin(); item != conf->Classes.end(); ++item)
+ {
+ if ((*item)->GetHost() == deny)
+ {
+ (*item)->Update(name, deny);
+ (*item)->SetPort(port);
+ return true;
+ }
+ }
ConnectClass* cc = new ConnectClass(name, deny);
cc->SetPort(port);
conf->Classes.push_back(cc);