diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-09-03 15:16:41 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-09-03 15:16:41 +0800 |
commit | e28f24a0c49768114d42cefa33ff79235b937d48 (patch) | |
tree | 64debb3969bccc0e35a0486651eed5dc141903a9 /mbbsd/mbbsd.c | |
parent | 478ea9614468014b20f9c5d500f7b802c10f9f78 (diff) | |
download | pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar.gz pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar.bz2 pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar.lz pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar.xz pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.tar.zst pttbbs-e28f24a0c49768114d42cefa33ff79235b937d48.zip |
domain_name_query is changed to cidr format
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2176 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r-- | mbbsd/mbbsd.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 7736d92d..eb935696 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -689,25 +689,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++; + 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 |