]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Move existing node out of the way.
authorYuri Schaeffer <yuri@nlnetlabs.nl>
Thu, 23 Apr 2015 07:51:38 +0000 (07:51 +0000)
committerYuri Schaeffer <yuri@nlnetlabs.nl>
Thu, 23 Apr 2015 07:51:38 +0000 (07:51 +0000)
formerr while parsing ipv6 ecs option

git-svn-id: file:///svn/unbound/branches/edns-subnet@3409 be551aaa-1e26-0410-a405-d3ace91eadb9

edns-subnet/addrtree.c
util/data/msgparse.c

index 729a3f0016ff489a3abe04f5615460095b3f52d3..9bba949135e26dfa3a036b626ed18658ed7d65df 100644 (file)
@@ -391,7 +391,9 @@ addrtree_insert(struct addrtree *tree, const addrkey_t *addr,
                /* Case 4: split. */
                if (!(newnode = node_create(tree, NULL, 0, 0)))
                        return;
+               node->edge[index] = NULL;
                if (!edge_create(newnode, addr, common, node, index)) {
+                       node->edge[index] = edge;
                        clean_node(tree, newnode);
                        tree->node_count--;
                        free(newnode);
index 4bf33b3527a2e629839e77d6ee020b00dabf76d4..d8d94f188fe6a2bad364da348afea7b93187f778 100644 (file)
@@ -955,7 +955,7 @@ parse_subnet_option(uint8_t* data, struct edns_data* edns, uint16_t opt_len)
        if (edns->subnet_addr_fam == EDNSSUBNET_ADDRFAM_IP4) {
                if (edns->subnet_source_mask > 32 || edns->subnet_scope_mask > 32)
                        return;
-       } else if (edns->subnet_addr_fam != EDNSSUBNET_ADDRFAM_IP6) {
+       } else if (edns->subnet_addr_fam == EDNSSUBNET_ADDRFAM_IP6) {
                if (edns->subnet_source_mask > 128 || edns->subnet_scope_mask > 128)
                        return;
        } else return;