]> jfr.im git - irc/quakenet/newserv.git/blobdiff - channel/channelbans.c
CHANNEL: Don't try and match IP addresses against bans with only numbers,
[irc/quakenet/newserv.git] / channel / channelbans.c
index 57af8bbf17a3c53098ebb89f0fb435253214e1ef..e56c60831a9037c9b6da3b3cb45dd35544de66f6 100644 (file)
@@ -83,7 +83,7 @@ int nickmatchban_visible(nick *np, chanban *bp) {
       return 0;
       
     if (bp->flags & CHANBAN_HOSTEXACT) {
-      /* If it's an exact IP ban we can compare it numerically */
+      /* Only exact IP bans are valid */
       unsigned int cip;
       unsigned char *ch;
 
@@ -97,12 +97,6 @@ int nickmatchban_visible(nick *np, chanban *bp) {
 
       if (cip==bp->ipaddr) 
         return 1;
-    } else {
-      /* It's not an exact IP ban so let's generate the string */
-      ipstring=IPtostr(np->p_ipaddr);
-      if (bp->flags & CHANBAN_HOSTMASK && match2strings(bp->host->content,ipstring))
-        return 1;
     }
   } else {
     /* Hostname bans need to be checked against +x host, +h host (if set) 
@@ -204,7 +198,7 @@ int nickmatchban(nick *np, chanban *bp) {
   
   if (bp->flags & CHANBAN_IP) {
     if (bp->flags & CHANBAN_HOSTEXACT) {
-      /* If it's an exact IP ban we can compare it numerically */
+      /* Only exact matches for IP bans */
       unsigned int cip;
       unsigned char *ch;
 
@@ -218,12 +212,6 @@ int nickmatchban(nick *np, chanban *bp) {
 
       if (cip==bp->ipaddr) 
         return 1;
-    } else {
-      /* It's not an exact IP ban so let's generate the string */
-      ipstring=IPtostr(np->p_ipaddr);
-      if (bp->flags & CHANBAN_HOSTMASK && match2strings(bp->host->content,ipstring))
-        return 1;
     }
   } else {
     /* Hostname bans need to be checked against +x host, +h host (if set)