"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/knot/events/handlers/ds_push.c" between
knot-2.9.1.tar.xz and knot-2.9.2.tar.xz

About: Knot DNS is a high-performance authoritative-only DNS server (supports zone transfers, dynamic updates and DNSSEC).

ds_push.c  (knot-2.9.1.tar.xz):ds_push.c  (knot-2.9.2.tar.xz)
skipping to change at line 178 skipping to change at line 178
} }
zone_cds.type = KNOT_RRTYPE_DS; zone_cds.type = KNOT_RRTYPE_DS;
struct ds_push_data data = { struct ds_push_data data = {
.zone = zone->name, .zone = zone->name,
.new_ds = zone_cds, .new_ds = zone_cds,
.remote = (struct sockaddr *)&parent->addr, .remote = (struct sockaddr *)&parent->addr,
}; };
knot_rrset_init(&data.del_old_ds, zone->name, KNOT_RRTYPE_DS, KNOT_CLASS_ ANY, 0); knot_rrset_init(&data.del_old_ds, zone->name, KNOT_RRTYPE_DS, KNOT_CLASS_ ANY, 0);
int ret = knot_rrset_add_rdata(&data.del_old_ds, NULL, 0, NULL);
if (ret != KNOT_EOK) {
return ret;
}
query_edns_data_init(&data.edns, conf, zone->name, parent->addr.ss_family ); query_edns_data_init(&data.edns, conf, zone->name, parent->addr.ss_family );
knot_requestor_t requestor; knot_requestor_t requestor;
knot_requestor_init(&requestor, &DS_PUSH_API, &data, NULL); knot_requestor_init(&requestor, &DS_PUSH_API, &data, NULL);
knot_pkt_t *pkt = knot_pkt_new(NULL, KNOT_WIRE_MAX_PKTSIZE, NULL); knot_pkt_t *pkt = knot_pkt_new(NULL, KNOT_WIRE_MAX_PKTSIZE, NULL);
if (pkt == NULL) { if (pkt == NULL) {
knot_rdataset_clear(&data.del_old_ds.rrs, NULL);
knot_requestor_clear(&requestor); knot_requestor_clear(&requestor);
return KNOT_ENOMEM; return KNOT_ENOMEM;
} }
const struct sockaddr_storage *dst = &parent->addr; const struct sockaddr_storage *dst = &parent->addr;
const struct sockaddr_storage *src = &parent->via; const struct sockaddr_storage *src = &parent->via;
knot_request_t *req = knot_request_make(NULL, dst, src, pkt, &parent->key , 0); knot_request_t *req = knot_request_make(NULL, dst, src, pkt, &parent->key , 0);
if (req == NULL) { if (req == NULL) {
knot_rdataset_clear(&data.del_old_ds.rrs, NULL);
knot_request_free(req, NULL); knot_request_free(req, NULL);
knot_requestor_clear(&requestor); knot_requestor_clear(&requestor);
return KNOT_ENOMEM; return KNOT_ENOMEM;
} }
int ret = knot_requestor_exec(&requestor, req, timeout); ret = knot_requestor_exec(&requestor, req, timeout);
if (ret == KNOT_EOK && knot_pkt_ext_rcode(req->resp) == 0) { if (ret == KNOT_EOK && knot_pkt_ext_rcode(req->resp) == 0) {
DS_PUSH_LOG(LOG_INFO, zone->name, dst, "success"); DS_PUSH_LOG(LOG_INFO, zone->name, dst, "success");
} else if (knot_pkt_ext_rcode(req->resp) == 0) { } else if (knot_pkt_ext_rcode(req->resp) == 0) {
DS_PUSH_LOG(LOG_WARNING, zone->name, dst, DS_PUSH_LOG(LOG_WARNING, zone->name, dst,
"failed (%s)", knot_strerror(ret)); "failed (%s)", knot_strerror(ret));
} else { } else {
DS_PUSH_LOG(LOG_WARNING, zone->name, dst, DS_PUSH_LOG(LOG_WARNING, zone->name, dst,
"server responded with error '%s'", "server responded with error '%s'",
knot_pkt_ext_rcode_name(req->resp)); knot_pkt_ext_rcode_name(req->resp));
} }
knot_rdataset_clear(&data.del_old_ds.rrs, NULL);
knot_request_free(req, NULL); knot_request_free(req, NULL);
knot_requestor_clear(&requestor); knot_requestor_clear(&requestor);
return ret; return ret;
} }
int event_ds_push(conf_t *conf, zone_t *zone) int event_ds_push(conf_t *conf, zone_t *zone)
{ {
assert(zone); assert(zone);
 End of changes. 5 change blocks. 
1 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)