]> jfr.im git - irc/quakenet/newserv.git/blobdiff - trusts/trusts_db.c
Merge pull request #1 from meeb/meeb
[irc/quakenet/newserv.git] / trusts / trusts_db.c
index 87a9209a0d2ba1e1e6320478c11f038091e25b68..1b04d3ee279ed1b4915a2b865aea02721964f01a 100644 (file)
@@ -197,7 +197,7 @@ static void loadgroups_fini(const DBAPIResult *result, void *tag) {
 
 static int trusts_connectdb(void) {
   if(!trustsdb) {
-    trustsdb = dbapi2open(NULL, "trusts");
+    trustsdb = dbapi2open("sqlite", "trusts");
     if(!trustsdb) {
       Error("trusts", ERR_WARNING, "Unable to connect to db -- not loaded.");
       return 0;
@@ -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;