summaryrefslogtreecommitdiff
path: root/src/libknot
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-12-07 11:16:22 +0100
committerOndřej Surý <ondrej@sury.org>2012-12-07 11:16:22 +0100
commit780528d331ee4eb4cf669725662b72e8704d2884 (patch)
tree25fffd121ffeb7a65bfd0f04f28da1b177928e08 /src/libknot
parentcd4e9e32d0666df8ed2e87a499c16158a6a2e0b1 (diff)
downloadknot-780528d331ee4eb4cf669725662b72e8704d2884.tar.gz
Imported Upstream version 1.1.3~rc1upstream/1.1.3_rc1
Diffstat (limited to 'src/libknot')
-rw-r--r--[-rwxr-xr-x]src/libknot/common.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/consts.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/dname.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/dname.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/edns.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/edns.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/hash/cuckoo-hash-table.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/hash/cuckoo-hash-table.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/hash/hash-functions.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/hash/hash-functions.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/hash/universal-system.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/hash/universal-system.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/libknot.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/nameserver/name-server.c7
-rw-r--r--[-rwxr-xr-x]src/libknot/nameserver/name-server.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/nsec3.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/nsec3.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/packet/packet.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/packet/packet.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/packet/query.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/packet/query.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/packet/response.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/packet/response.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/rdata.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/rdata.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/rrset.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/rrset.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/tsig-op.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/tsig-op.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/tsig.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/tsig.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/updates/changesets.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/updates/changesets.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/updates/ddns.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/updates/ddns.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/updates/xfr-in.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/updates/xfr-in.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/util/debug.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/util/debug.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/util/descriptor.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/util/descriptor.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/util/tolower.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/util/tolower.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/util/utils.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/util/utils.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/util/wire.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/dname-table.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/dname-table.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/node.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/node.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/zone-contents.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/zone-contents.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/zone-diff.c67
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/zone-diff.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/zone-tree.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/zone-tree.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/zone.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/zone.h0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/zonedb.c0
-rw-r--r--[-rwxr-xr-x]src/libknot/zone/zonedb.h0
60 files changed, 73 insertions, 1 deletions
diff --git a/src/libknot/common.h b/src/libknot/common.h
index 0bff97e..0bff97e 100755..100644
--- a/src/libknot/common.h
+++ b/src/libknot/common.h
diff --git a/src/libknot/consts.h b/src/libknot/consts.h
index 4249763..4249763 100755..100644
--- a/src/libknot/consts.h
+++ b/src/libknot/consts.h
diff --git a/src/libknot/dname.c b/src/libknot/dname.c
index eed2fd6..eed2fd6 100755..100644
--- a/src/libknot/dname.c
+++ b/src/libknot/dname.c
diff --git a/src/libknot/dname.h b/src/libknot/dname.h
index 347e699..347e699 100755..100644
--- a/src/libknot/dname.h
+++ b/src/libknot/dname.h
diff --git a/src/libknot/edns.c b/src/libknot/edns.c
index a71c4eb..a71c4eb 100755..100644
--- a/src/libknot/edns.c
+++ b/src/libknot/edns.c
diff --git a/src/libknot/edns.h b/src/libknot/edns.h
index d59050e..d59050e 100755..100644
--- a/src/libknot/edns.h
+++ b/src/libknot/edns.h
diff --git a/src/libknot/hash/cuckoo-hash-table.c b/src/libknot/hash/cuckoo-hash-table.c
index 7358e14..7358e14 100755..100644
--- a/src/libknot/hash/cuckoo-hash-table.c
+++ b/src/libknot/hash/cuckoo-hash-table.c
diff --git a/src/libknot/hash/cuckoo-hash-table.h b/src/libknot/hash/cuckoo-hash-table.h
index c0fe9cc..c0fe9cc 100755..100644
--- a/src/libknot/hash/cuckoo-hash-table.h
+++ b/src/libknot/hash/cuckoo-hash-table.h
diff --git a/src/libknot/hash/hash-functions.c b/src/libknot/hash/hash-functions.c
index a33dd6b..a33dd6b 100755..100644
--- a/src/libknot/hash/hash-functions.c
+++ b/src/libknot/hash/hash-functions.c
diff --git a/src/libknot/hash/hash-functions.h b/src/libknot/hash/hash-functions.h
index f23730b..f23730b 100755..100644
--- a/src/libknot/hash/hash-functions.h
+++ b/src/libknot/hash/hash-functions.h
diff --git a/src/libknot/hash/universal-system.c b/src/libknot/hash/universal-system.c
index 096974c..096974c 100755..100644
--- a/src/libknot/hash/universal-system.c
+++ b/src/libknot/hash/universal-system.c
diff --git a/src/libknot/hash/universal-system.h b/src/libknot/hash/universal-system.h
index 25330de..25330de 100755..100644
--- a/src/libknot/hash/universal-system.h
+++ b/src/libknot/hash/universal-system.h
diff --git a/src/libknot/libknot.h b/src/libknot/libknot.h
index 287233d..287233d 100755..100644
--- a/src/libknot/libknot.h
+++ b/src/libknot/libknot.h
diff --git a/src/libknot/nameserver/name-server.c b/src/libknot/nameserver/name-server.c
index 10d8671..0a7a298 100755..100644
--- a/src/libknot/nameserver/name-server.c
+++ b/src/libknot/nameserver/name-server.c
@@ -1701,7 +1701,7 @@ static inline int ns_referral(const knot_node_t *node,
&& knot_query_dnssec_requested(
knot_packet_query(resp))) {
ret = ns_add_rrsigs(ds_rrset, resp, node->owner,
- knot_response_add_rrset_authority,
+ knot_response_add_rrset_answer,
1);
}
} else {
@@ -1716,6 +1716,9 @@ static inline int ns_referral(const knot_node_t *node,
ret = ns_put_authority_soa(zone, resp);
}
+
+ // This is an authoritative answer, set AA bit
+ knot_response_set_aa(resp);
return ret;
}
@@ -2424,6 +2427,8 @@ static int ns_error_response_to_wire(knot_packet_t *resp, uint8_t *wire,
short edns_size = knot_edns_to_wire(&resp->opt_rr, wire + rsize,
*wire_size - rsize);
if (edns_size > 0) {
+ uint16_t ar_count = knot_wire_get_arcount(wire);
+ knot_wire_set_arcount(wire, ar_count + 1);
*wire_size = rsize + edns_size;
}
} else {
diff --git a/src/libknot/nameserver/name-server.h b/src/libknot/nameserver/name-server.h
index 3fe1210..3fe1210 100755..100644
--- a/src/libknot/nameserver/name-server.h
+++ b/src/libknot/nameserver/name-server.h
diff --git a/src/libknot/nsec3.c b/src/libknot/nsec3.c
index 23130ba..23130ba 100755..100644
--- a/src/libknot/nsec3.c
+++ b/src/libknot/nsec3.c
diff --git a/src/libknot/nsec3.h b/src/libknot/nsec3.h
index 7efd229..7efd229 100755..100644
--- a/src/libknot/nsec3.h
+++ b/src/libknot/nsec3.h
diff --git a/src/libknot/packet/packet.c b/src/libknot/packet/packet.c
index 6a047fb..6a047fb 100755..100644
--- a/src/libknot/packet/packet.c
+++ b/src/libknot/packet/packet.c
diff --git a/src/libknot/packet/packet.h b/src/libknot/packet/packet.h
index 522ae8e..522ae8e 100755..100644
--- a/src/libknot/packet/packet.h
+++ b/src/libknot/packet/packet.h
diff --git a/src/libknot/packet/query.c b/src/libknot/packet/query.c
index 8f4cf18..8f4cf18 100755..100644
--- a/src/libknot/packet/query.c
+++ b/src/libknot/packet/query.c
diff --git a/src/libknot/packet/query.h b/src/libknot/packet/query.h
index cda72b9..cda72b9 100755..100644
--- a/src/libknot/packet/query.h
+++ b/src/libknot/packet/query.h
diff --git a/src/libknot/packet/response.c b/src/libknot/packet/response.c
index c6a1a09..c6a1a09 100755..100644
--- a/src/libknot/packet/response.c
+++ b/src/libknot/packet/response.c
diff --git a/src/libknot/packet/response.h b/src/libknot/packet/response.h
index beb1a59..beb1a59 100755..100644
--- a/src/libknot/packet/response.h
+++ b/src/libknot/packet/response.h
diff --git a/src/libknot/rdata.c b/src/libknot/rdata.c
index 9bcdbe5..9bcdbe5 100755..100644
--- a/src/libknot/rdata.c
+++ b/src/libknot/rdata.c
diff --git a/src/libknot/rdata.h b/src/libknot/rdata.h
index 57517bd..57517bd 100755..100644
--- a/src/libknot/rdata.h
+++ b/src/libknot/rdata.h
diff --git a/src/libknot/rrset.c b/src/libknot/rrset.c
index d8b10ce..d8b10ce 100755..100644
--- a/src/libknot/rrset.c
+++ b/src/libknot/rrset.c
diff --git a/src/libknot/rrset.h b/src/libknot/rrset.h
index b5b62db..b5b62db 100755..100644
--- a/src/libknot/rrset.h
+++ b/src/libknot/rrset.h
diff --git a/src/libknot/tsig-op.c b/src/libknot/tsig-op.c
index cb280ab..cb280ab 100755..100644
--- a/src/libknot/tsig-op.c
+++ b/src/libknot/tsig-op.c
diff --git a/src/libknot/tsig-op.h b/src/libknot/tsig-op.h
index 07a84a8..07a84a8 100755..100644
--- a/src/libknot/tsig-op.h
+++ b/src/libknot/tsig-op.h
diff --git a/src/libknot/tsig.c b/src/libknot/tsig.c
index a4a8f1b..a4a8f1b 100755..100644
--- a/src/libknot/tsig.c
+++ b/src/libknot/tsig.c
diff --git a/src/libknot/tsig.h b/src/libknot/tsig.h
index cd5910f..cd5910f 100755..100644
--- a/src/libknot/tsig.h
+++ b/src/libknot/tsig.h
diff --git a/src/libknot/updates/changesets.c b/src/libknot/updates/changesets.c
index ab83b07..ab83b07 100755..100644
--- a/src/libknot/updates/changesets.c
+++ b/src/libknot/updates/changesets.c
diff --git a/src/libknot/updates/changesets.h b/src/libknot/updates/changesets.h
index 642b155..642b155 100755..100644
--- a/src/libknot/updates/changesets.h
+++ b/src/libknot/updates/changesets.h
diff --git a/src/libknot/updates/ddns.c b/src/libknot/updates/ddns.c
index 72a1be9..72a1be9 100755..100644
--- a/src/libknot/updates/ddns.c
+++ b/src/libknot/updates/ddns.c
diff --git a/src/libknot/updates/ddns.h b/src/libknot/updates/ddns.h
index 35dfcb7..35dfcb7 100755..100644
--- a/src/libknot/updates/ddns.h
+++ b/src/libknot/updates/ddns.h
diff --git a/src/libknot/updates/xfr-in.c b/src/libknot/updates/xfr-in.c
index 7d3ffdf..7d3ffdf 100755..100644
--- a/src/libknot/updates/xfr-in.c
+++ b/src/libknot/updates/xfr-in.c
diff --git a/src/libknot/updates/xfr-in.h b/src/libknot/updates/xfr-in.h
index a762b81..a762b81 100755..100644
--- a/src/libknot/updates/xfr-in.h
+++ b/src/libknot/updates/xfr-in.h
diff --git a/src/libknot/util/debug.c b/src/libknot/util/debug.c
index a6555ad..a6555ad 100755..100644
--- a/src/libknot/util/debug.c
+++ b/src/libknot/util/debug.c
diff --git a/src/libknot/util/debug.h b/src/libknot/util/debug.h
index 731fed8..731fed8 100755..100644
--- a/src/libknot/util/debug.h
+++ b/src/libknot/util/debug.h
diff --git a/src/libknot/util/descriptor.c b/src/libknot/util/descriptor.c
index 1588a2e..1588a2e 100755..100644
--- a/src/libknot/util/descriptor.c
+++ b/src/libknot/util/descriptor.c
diff --git a/src/libknot/util/descriptor.h b/src/libknot/util/descriptor.h
index 6364e5b..6364e5b 100755..100644
--- a/src/libknot/util/descriptor.h
+++ b/src/libknot/util/descriptor.h
diff --git a/src/libknot/util/tolower.c b/src/libknot/util/tolower.c
index d71c467..d71c467 100755..100644
--- a/src/libknot/util/tolower.c
+++ b/src/libknot/util/tolower.c
diff --git a/src/libknot/util/tolower.h b/src/libknot/util/tolower.h
index 2e92258..2e92258 100755..100644
--- a/src/libknot/util/tolower.h
+++ b/src/libknot/util/tolower.h
diff --git a/src/libknot/util/utils.c b/src/libknot/util/utils.c
index 04e12c5..04e12c5 100755..100644
--- a/src/libknot/util/utils.c
+++ b/src/libknot/util/utils.c
diff --git a/src/libknot/util/utils.h b/src/libknot/util/utils.h
index fd275b3..fd275b3 100755..100644
--- a/src/libknot/util/utils.h
+++ b/src/libknot/util/utils.h
diff --git a/src/libknot/util/wire.h b/src/libknot/util/wire.h
index 0a24ff1..0a24ff1 100755..100644
--- a/src/libknot/util/wire.h
+++ b/src/libknot/util/wire.h
diff --git a/src/libknot/zone/dname-table.c b/src/libknot/zone/dname-table.c
index f86bb90..f86bb90 100755..100644
--- a/src/libknot/zone/dname-table.c
+++ b/src/libknot/zone/dname-table.c
diff --git a/src/libknot/zone/dname-table.h b/src/libknot/zone/dname-table.h
index 945b6de..945b6de 100755..100644
--- a/src/libknot/zone/dname-table.h
+++ b/src/libknot/zone/dname-table.h
diff --git a/src/libknot/zone/node.c b/src/libknot/zone/node.c
index eca4abc..eca4abc 100755..100644
--- a/src/libknot/zone/node.c
+++ b/src/libknot/zone/node.c
diff --git a/src/libknot/zone/node.h b/src/libknot/zone/node.h
index 4e0b2c4..4e0b2c4 100755..100644
--- a/src/libknot/zone/node.h
+++ b/src/libknot/zone/node.h
diff --git a/src/libknot/zone/zone-contents.c b/src/libknot/zone/zone-contents.c
index 61e9e51..61e9e51 100755..100644
--- a/src/libknot/zone/zone-contents.c
+++ b/src/libknot/zone/zone-contents.c
diff --git a/src/libknot/zone/zone-contents.h b/src/libknot/zone/zone-contents.h
index 52eaa40..52eaa40 100755..100644
--- a/src/libknot/zone/zone-contents.h
+++ b/src/libknot/zone/zone-contents.h
diff --git a/src/libknot/zone/zone-diff.c b/src/libknot/zone/zone-diff.c
index 65f162f..734c7c2 100755..100644
--- a/src/libknot/zone/zone-diff.c
+++ b/src/libknot/zone/zone-diff.c
@@ -423,6 +423,39 @@ static int knot_zone_diff_rdata(const knot_rrset_t *rrset1,
dbg_zonediff_detail("zone_diff: diff_rdata: To remove:\n");
knot_rrset_dump(to_remove, 1);
+ /*
+ * to_remove RRSet might be empty, meaning that
+ * there are no differences in RDATA, but TTLs can differ.
+ */
+ if (rrset1 && rrset2 &&
+ (knot_rrset_ttl(rrset1) != knot_rrset_ttl(rrset2)) &&
+ knot_rrset_rdata_rr_count(to_remove) == 0) {
+ /* We have to remove old TTL. */
+ assert(knot_rrset_ttl(to_remove) == knot_rrset_ttl(rrset1));
+ /*
+ * Fill the RDATA so that the change gets saved. All RRs can
+ * be copied because TTLs are the same for all of them.
+ */
+ knot_rdata_t *tmp_rdata_copy =
+ knot_rdata_deep_copy(knot_rrset_rdata(rrset1),
+ knot_rrset_type(rrset1),
+ 1);
+ if (tmp_rdata_copy == NULL) {
+ dbg_zonediff("zone diff: diff_rdata: Cannot copy "
+ "RDATA (Different TTLs).\n");
+ /* TODO cleanup. */
+ return KNOT_ENOMEM;
+ }
+ int ret = knot_rrset_add_rdata(to_remove, tmp_rdata_copy);
+ if (ret != KNOT_EOK) {
+ dbg_zonediff("zone diff: diff_rdata: Cannot add "
+ "RDATA to RRSet. Reason: %s\n",
+ knot_strerror(ret));
+ /* TODO cleanup. */
+ return ret;
+ }
+ }
+
int ret = knot_zone_diff_changeset_remove_rrset(changeset,
to_remove);
if (ret != KNOT_EOK) {
@@ -462,6 +495,40 @@ static int knot_zone_diff_rdata(const knot_rrset_t *rrset1,
dbg_zonediff_detail("zone_diff: diff_rdata: To add:\n");
knot_rrset_dump(to_add, 1);
+
+ /*
+ * to_remove RRSet might be empty, meaning that
+ * there are no differences in RDATA, but TTLs can differ.
+ */
+ if (rrset1 && rrset2 &&
+ knot_rrset_ttl(rrset1) != knot_rrset_ttl(rrset2)) {
+ /* We have to add newer TTL. */
+ knot_rrset_set_ttl(to_add, knot_rrset_ttl(rrset2));
+ if (knot_rrset_rdata_rr_count(to_add) == 0) {
+ /*
+ * Fill the RDATA so that the change gets saved. All RRs can
+ * be copied because TTLs are the same for all of them.
+ */
+ knot_rdata_t *tmp_rdata_copy =
+ knot_rdata_deep_copy(knot_rrset_rdata(rrset1),
+ knot_rrset_type(rrset1),
+ 1);
+ if (tmp_rdata_copy == NULL) {
+ dbg_zonediff("zone diff: diff_rdata: Cannot copy "
+ "RDATA (Different TTLs).\n");
+ /* TODO cleanup. */
+ return KNOT_ENOMEM;
+ }
+ int ret = knot_rrset_add_rdata(to_add, tmp_rdata_copy);
+ if (ret != KNOT_EOK) {
+ dbg_zonediff("zone diff: diff_rdata: Cannot add "
+ "RDATA to RRSet. Reason: %s\n",
+ knot_strerror(ret));
+ /* TODO cleanup. */
+ return ret;
+ }
+ }
+ }
ret = knot_zone_diff_changeset_add_rrset(changeset,
to_add);
diff --git a/src/libknot/zone/zone-diff.h b/src/libknot/zone/zone-diff.h
index 6e0eb1d..6e0eb1d 100755..100644
--- a/src/libknot/zone/zone-diff.h
+++ b/src/libknot/zone/zone-diff.h
diff --git a/src/libknot/zone/zone-tree.c b/src/libknot/zone/zone-tree.c
index ceaa6a9..ceaa6a9 100755..100644
--- a/src/libknot/zone/zone-tree.c
+++ b/src/libknot/zone/zone-tree.c
diff --git a/src/libknot/zone/zone-tree.h b/src/libknot/zone/zone-tree.h
index 6c38310..6c38310 100755..100644
--- a/src/libknot/zone/zone-tree.h
+++ b/src/libknot/zone/zone-tree.h
diff --git a/src/libknot/zone/zone.c b/src/libknot/zone/zone.c
index 3ab508e..3ab508e 100755..100644
--- a/src/libknot/zone/zone.c
+++ b/src/libknot/zone/zone.c
diff --git a/src/libknot/zone/zone.h b/src/libknot/zone/zone.h
index 31ff2ac..31ff2ac 100755..100644
--- a/src/libknot/zone/zone.h
+++ b/src/libknot/zone/zone.h
diff --git a/src/libknot/zone/zonedb.c b/src/libknot/zone/zonedb.c
index 5e5c516..5e5c516 100755..100644
--- a/src/libknot/zone/zonedb.c
+++ b/src/libknot/zone/zonedb.c
diff --git a/src/libknot/zone/zonedb.h b/src/libknot/zone/zonedb.h
index 81326bf..81326bf 100755..100644
--- a/src/libknot/zone/zonedb.h
+++ b/src/libknot/zone/zonedb.h