From: splidge Date: Sat, 18 Jul 2009 15:15:29 +0000 (+0100) Subject: CHANNEL: Don't try and match IP addresses against bans with only numbers, X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/3d417b1cdfd1b4a9f2d8a8e8000d7c7ad939cf64?hp=5bc296cea412ea68e1b5c7b8abac87eae85d15ac CHANNEL: Don't try and match IP addresses against bans with only numbers, dots and wildcards any more. --- diff --git a/channel/channelbans.c b/channel/channelbans.c index 57af8bbf..e56c6083 100644 --- a/channel/channelbans.c +++ b/channel/channelbans.c @@ -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)