Deleted Added
full compact
dns64.c (276605) dns64.c (287917)
1/*
2 * dns64/dns64.c - DNS64 module
3 *
4 * Copyright (c) 2009, Viag��nie. All rights reserved.
5 *
6 * This software is open source.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 576 unchanged lines hidden (view full) ---

585{
586 struct packed_rrset_data *dd;
587 size_t i;
588 /*
589 * Create synthesized AAAA RR set data. We need to allocated extra memory
590 * for the RRs themselves. Each RR has a length, TTL, pointer to wireformat
591 * data, 2 bytes of data length, and 16 bytes of IPv6 address.
592 */
1/*
2 * dns64/dns64.c - DNS64 module
3 *
4 * Copyright (c) 2009, Viag��nie. All rights reserved.
5 *
6 * This software is open source.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 576 unchanged lines hidden (view full) ---

585{
586 struct packed_rrset_data *dd;
587 size_t i;
588 /*
589 * Create synthesized AAAA RR set data. We need to allocated extra memory
590 * for the RRs themselves. Each RR has a length, TTL, pointer to wireformat
591 * data, 2 bytes of data length, and 16 bytes of IPv6 address.
592 */
593 if(fd->count > RR_COUNT_MAX) {
594 *dd_out = NULL;
595 return; /* integer overflow protection in alloc */
596 }
593 if (!(dd = *dd_out = regional_alloc(region,
594 sizeof(struct packed_rrset_data)
595 + fd->count * (sizeof(size_t) + sizeof(time_t) +
596 sizeof(uint8_t*) + 2 + 16)))) {
597 log_err("out of memory");
598 return;
599 }
600

--- 107 unchanged lines hidden (view full) ---

708 dk = cp->rrsets[i];
709 fd = (struct packed_rrset_data*)fk->entry.data;
710 dk->rk = fk->rk;
711 dk->id = fk->id;
712
713 if(i<rep->an_numrrsets && fk->rk.type == htons(LDNS_RR_TYPE_A)) {
714 /* also sets dk->entry.hash */
715 dns64_synth_aaaa_data(fk, fd, dk, &dd, super->region, dns64_env);
597 if (!(dd = *dd_out = regional_alloc(region,
598 sizeof(struct packed_rrset_data)
599 + fd->count * (sizeof(size_t) + sizeof(time_t) +
600 sizeof(uint8_t*) + 2 + 16)))) {
601 log_err("out of memory");
602 return;
603 }
604

--- 107 unchanged lines hidden (view full) ---

712 dk = cp->rrsets[i];
713 fd = (struct packed_rrset_data*)fk->entry.data;
714 dk->rk = fk->rk;
715 dk->id = fk->id;
716
717 if(i<rep->an_numrrsets && fk->rk.type == htons(LDNS_RR_TYPE_A)) {
718 /* also sets dk->entry.hash */
719 dns64_synth_aaaa_data(fk, fd, dk, &dd, super->region, dns64_env);
720 if(!dd)
721 return;
716 /* Delete negative AAAA record from cache stored by
717 * the iterator module */
718 rrset_cache_remove(super->env->rrset_cache, dk->rk.dname,
719 dk->rk.dname_len, LDNS_RR_TYPE_AAAA,
720 LDNS_RR_CLASS_IN, 0);
721 } else {
722 dk->entry.hash = fk->entry.hash;
723 dk->rk.dname = (uint8_t*)regional_alloc_init(super->region,

--- 144 unchanged lines hidden ---
722 /* Delete negative AAAA record from cache stored by
723 * the iterator module */
724 rrset_cache_remove(super->env->rrset_cache, dk->rk.dname,
725 dk->rk.dname_len, LDNS_RR_TYPE_AAAA,
726 LDNS_RR_CLASS_IN, 0);
727 } else {
728 dk->entry.hash = fk->entry.hash;
729 dk->rk.dname = (uint8_t*)regional_alloc_init(super->region,

--- 144 unchanged lines hidden ---