There are no available options for this view.

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by botg, Mon Jun 28 09:43:22 2004 UTC revision 1.13 by botg, Fri Jul 2 14:45:31 2004 UTC
# Line 139  Line 139 
139                  ips = ips.Mid(pos + 1);                  ips = ips.Mid(pos + 1);
140                  pos = ips.Find(' ');                  pos = ips.Find(' ');
141    
142                    if (blockedIP == "*")
143                    {
144                            disallowed = true;
145                            break;
146                    }
147    
148                  int pos2 = blockedIP.Find('-');                  int pos2 = blockedIP.Find('-');
149                  if (pos2 != -1)                  if (pos2 != -1)
150                  {                  {
151                          unsigned int min = htonl(inet_addr(blockedIP.Left(pos2)));                          unsigned int min = htonl(inet_addr(blockedIP.Left(pos2)));
152                          unsigned int max = htonl(inet_addr(blockedIP.Mid(pos2 + 1)));                          unsigned int max = htonl(inet_addr(blockedIP.Mid(pos2 + 1)));
153                          if (ip >= min || ip <= max)                          if (ip >= min && ip <= max)
154                          {                          {
155                                  disallowed = true;                                  disallowed = true;
156                                  break;                                  break;
# Line 210  Line 216 
216                  ips = ips.Mid(pos + 1);                  ips = ips.Mid(pos + 1);
217                  pos = ips.Find(' ');                  pos = ips.Find(' ');
218    
219                    if (blockedIP == "*")
220                            return true;
221    
222                  int pos2 = blockedIP.Find('-');                  int pos2 = blockedIP.Find('-');
223                  if (pos2 != -1)                  if (pos2 != -1)
224                  {                  {
225                          unsigned int min = htonl(inet_addr(blockedIP.Left(pos2)));                          unsigned int min = htonl(inet_addr(blockedIP.Left(pos2)));
226                          unsigned int max = htonl(inet_addr(blockedIP.Mid(pos2 + 1)));                          unsigned int max = htonl(inet_addr(blockedIP.Mid(pos2 + 1)));
227                          if (ip >= min || ip <= max)                          if (ip >= min && ip <= max)
228                                  return true;                                  return true;
229    
230                          continue;                          continue;

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13