]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
limit size of tree
authorYuri Schaeffer <yuri@nlnetlabs.nl>
Fri, 18 Oct 2013 08:33:42 +0000 (08:33 +0000)
committerYuri Schaeffer <yuri@nlnetlabs.nl>
Fri, 18 Oct 2013 08:33:42 +0000 (08:33 +0000)
git-svn-id: file:///svn/unbound/branches/edns-subnet@2988 be551aaa-1e26-0410-a405-d3ace91eadb9

edns-subnet/subnetmod.c

index 4ff30757d39e49352232cbe0fb30cd5f1fc8cfd0..840e02849a030d39c64cb2a8d93ae2c3d88d2cf7 100644 (file)
@@ -27,6 +27,8 @@
 #include "util/config_file.h"
 #include "util/data/msgreply.h"
 
+#define ECS_MAX_TREESIZE 100
+
 /** externally called */
 void 
 subnet_data_delete(void *d, void *ATTR_UNUSED(arg))
@@ -131,12 +133,12 @@ get_tree(struct subnet_msg_cache_data *data, struct edns_data *edns,
        if (edns->subnet_addr_fam == EDNSSUBNET_ADDRFAM_IP4) {
                if (!data->tree4)
                        data->tree4 = addrtree_create(EDNSSUBNET_MAX_SUBNET_IP4, 
-                               &delfunc, &sizefunc, env, 0);
+                               &delfunc, &sizefunc, env, ECS_MAX_TREESIZE);
                tree = data->tree4;
        } else {
                if (!data->tree6)
                        data->tree6 = addrtree_create(EDNSSUBNET_MAX_SUBNET_IP6, 
-                               &delfunc, &sizefunc, env, 0);
+                               &delfunc, &sizefunc, env, ECS_MAX_TREESIZE);
                tree = data->tree6;
        }
        return tree;