summaryrefslogtreecommitdiffstats
path: root/mbbsd/mbbsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r--mbbsd/mbbsd.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 151bf6e9..f3468cbb 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -696,25 +696,14 @@ del_distinct(char *fname, char *line)
static int
where(char *from)
{
- register int i = 0, count = 0, j;
-
- for (j = 0; j < SHM->top; j++) {
- char *token = strtok(SHM->domain[j], "&");
-
- i = 0;
- count = 0;
- while (token) {
- if (strstr(from, token))
- count++;
- token = strtok(NULL, "&");
- i++;
+ register int i;
+
+ for (i = 0; i < SHM->home_num; i++) {
+ if ((SHM->home_ip[i] & SHM->home_mask[i]) == (ipstr2int(from) & SHM->home_mask[i])) {
+ return i;
}
- if (i == count)
- break;
}
- if (i != count)
- return 0;
- return j;
+ return 0;
}
#endif