]> jfr.im git - irc/unrealircd/unrealircd.git/commitdiff
* The except throttle { } block now also overrides any limitations from
authorBram Matthys <redacted>
Sun, 2 Sep 2018 09:40:15 +0000 (11:40 +0200)
committerBram Matthys <redacted>
Sun, 2 Sep 2018 09:40:15 +0000 (11:40 +0200)
  set::max-unknown-connection-per-ip. Useful for WEBIRC/cgiirc gateways.
Reported by KnuX https://bugs.unrealircd.org/view.php?id=5088

doc/RELEASE-NOTES
src/s_bsd.c

index ae33e90aa9646c9a9028a1379ed9fbf04806ca88..a2c6bc161ce9a54fe0dd7668fa36f79a41e56cb4 100644 (file)
@@ -10,6 +10,8 @@ Enhancements:
   This is especially useful if you only want to disable a few modules
   that are (normally) automatically loaded by conf/modules.default.conf.
   https://www.unrealircd.org/docs/Blacklist-module_directive
+* The except throttle { } block now also overrides any limitations from
+  set::max-unknown-connection-per-ip. Useful for WEBIRC/cgiirc gateways.
 * The following extban modules are not new but are now enabled by default:
   extbans/textban, extbans/timedban and extbans/msgbypass.
   In case you don't like them, use blacklist-module as mentioned above.
index 3cbaf057b6c19487ddd9ccd36c11ff2a95e0e339..d0e18cc5c344c245c6506f8353da2f751eaabbf0 100644 (file)
@@ -1036,19 +1036,22 @@ add_con_refuse:
 
        j = 1;
 
-       list_for_each_entry(acptr2, &unknown_list, lclient_node)
+       if (!Find_except(acptr, CONF_EXCEPT_THROTTLE))
        {
-               if (!strcmp(acptr->ip,GetIP(acptr2)))
+               list_for_each_entry(acptr2, &unknown_list, lclient_node)
                {
-                       j++;
-                       if (j > iConf.max_unknown_connections_per_ip)
+                       if (!strcmp(acptr->ip,GetIP(acptr2)))
                        {
-                               ircsnprintf(zlinebuf, sizeof(zlinebuf),
-                                       "ERROR :Closing Link: [%s] (Too many unknown connections from your IP)"
-                                       "\r\n",
-                                       acptr->ip);
-                               (void)send(fd, zlinebuf, strlen(zlinebuf), 0);
-                               goto add_con_refuse;
+                               j++;
+                               if (j > iConf.max_unknown_connections_per_ip)
+                               {
+                                       ircsnprintf(zlinebuf, sizeof(zlinebuf),
+                                               "ERROR :Closing Link: [%s] (Too many unknown connections from your IP)"
+                                               "\r\n",
+                                               acptr->ip);
+                                       (void)send(fd, zlinebuf, strlen(zlinebuf), 0);
+                                       goto add_con_refuse;
+                               }
                        }
                }
        }