]> jfr.im git - irc/quakenet/newserv.git/blobdiff - trusts/trusts_db.c
trusts: Make sure nodebits is always less than or equal to the mask's bits.
[irc/quakenet/newserv.git] / trusts / trusts_db.c
index 87a9209a0d2ba1e1e6320478c11f038091e25b68..792c5fa3c8c2c18d276db2ad9a8d2819c47b44b9 100644 (file)
@@ -284,6 +284,9 @@ trusthost *th_new(trustgroup *tg, char *host) {
   nth.maxpernode = 0;
   nth.nodebits = (irc_in_addr_is_ipv4(&nth.ip))?128:64;
 
+  if (nth.bits < nth.nodebits)
+    nth.nodebits = nth.bits;
+
   th = th_copy(&nth);
   if(!th)
     return NULL;