From: wessels <> Date: Fri, 27 Mar 1998 11:44:54 +0000 (+0000) Subject: warn about adding duplicate/overlapping IP keys for binary trees X-Git-Tag: SQUID_3_0_PRE1~3740 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f40e41cf94de0b9a81696a860958d9712d4cb806;p=thirdparty%2Fsquid.git warn about adding duplicate/overlapping IP keys for binary trees --- diff --git a/src/acl.cc b/src/acl.cc index 22a62d5aea..ed84fc77b9 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,6 +1,6 @@ /* - * $Id: acl.cc,v 1.152 1998/03/17 03:59:21 wessels Exp $ + * $Id: acl.cc,v 1.153 1998/03/27 04:44:54 wessels Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -477,13 +477,21 @@ aclParseIpList(void **curtree) tree **Tree; char *t = NULL; acl_ip_data *q; + acl_ip_data *x; Tree = xmalloc(sizeof(tree *)); *curtree = Tree; tree_init(Tree); while ((t = strtokFile())) { q = aclParseIpData(t); while (q != NULL) { - tree_add(Tree, bintreeNetworkCompare, q, NULL); + x = tree_srch(Tree, bintreeIpNetworkCompare, &q->addr1); + if (NULL != x) { + debug(0, 0) ("aclParseIpList: Ignoring duplicate/clashing entry\n"); + debug(0, 0) ("--> %s already exists\n", inet_ntoa(x->addr1)); + debug(0, 0) ("--> %s is ignored\n", inet_ntoa(q->addr1)); + } else { + tree_add(Tree, bintreeNetworkCompare, q, NULL); + } q = q->next; } }