getxfrins xml x$n || return 1
getxfrins json j$n || return 1
# XML is encoded in one line, use sed to separate each transfer
- count=$(sed 's/<xfrin /\n<xfrin /g' xfrins.xml.x$n | grep -c '<state>\(Initial SOA\|First Data\|Receiving AXFR Data\)</state>')
+ count=$(sed 's/<xfrin /\n<xfrin /g' xfrins.xml.x$n | grep -c '<state>\(Zone Transfer Request\|First Data\|Receiving AXFR Data\)</state>')
if [ $count != 3 ]; then return 1; fi
- count=$(grep -c '"state":"\(Initial SOA\|First Data\|Receiving AXFR Data\)"' xfrins.json.j$n)
+ count=$(grep -c '"state":"\(Zone Transfer Request\|First Data\|Receiving AXFR Data\)"' xfrins.json.j$n)
if [ $count != 3 ]; then return 1; fi
}
typedef enum {
XFRST_SOAQUERY,
XFRST_GOTSOA,
- XFRST_INITIALSOA,
+ XFRST_ZONEXFRREQUEST,
XFRST_FIRSTDATA,
XFRST_IXFR_DELSOA,
XFRST_IXFR_DEL,
*/
break;
- case XFRST_INITIALSOA:
+ case XFRST_ZONEXFRREQUEST:
if (rdata->type != dns_rdatatype_soa) {
xfrin_log(xfr, ISC_LOG_NOTICE,
"first RR in zone transfer must be SOA");
case XFRST_GOTSOA:
*statestr = "Got SOA";
break;
- case XFRST_INITIALSOA:
- *statestr = "Initial SOA";
+ case XFRST_ZONEXFRREQUEST:
+ *statestr = "Zone Transfer Request";
break;
case XFRST_FIRSTDATA:
*statestr = "First Data";
if (reqtype == dns_rdatatype_soa) {
atomic_init(&xfr->state, XFRST_SOAQUERY);
} else {
- atomic_init(&xfr->state, XFRST_INITIALSOA);
+ atomic_init(&xfr->state, XFRST_ZONEXFRREQUEST);
}
xfr->start = isc_time_now();
/*
* If the transfer is started when the 'state' is XFRST_SOAQUERY, it
* means the SOA query will be performed by xfrin. A transfer could also
- * be initiated starting from the XFRST_INITIALSOA state, which means
- * that the SOA query was already performed by other means (e.g. by
- * zone.c:soa_query()), or that it's a transfer without a preceding
+ * be initiated starting from the XFRST_ZONEXFRREQUEST state, which
+ * means that the SOA query was already performed by other means (e.g.
+ * by zone.c:soa_query()), or that it's a transfer without a preceding
* SOA request, and 'soa_transport_type' is already correctly
* set by the creator of the xfrin.
*/
if (result == ISC_R_SUCCESS &&
msg->rcode == dns_rcode_formerr && xfr->edns &&
(atomic_load(&xfr->state) == XFRST_SOAQUERY ||
- atomic_load(&xfr->state) == XFRST_INITIALSOA))
+ atomic_load(&xfr->state) == XFRST_ZONEXFRREQUEST))
{
xfr->edns = false;
dns_message_detach(&msg);
}
if ((atomic_load(&xfr->state) == XFRST_SOAQUERY ||
- atomic_load(&xfr->state) == XFRST_INITIALSOA) &&
+ atomic_load(&xfr->state) == XFRST_ZONEXFRREQUEST) &&
msg->counts[DNS_SECTION_QUESTION] != 1)
{
xfrin_log(xfr, ISC_LOG_NOTICE, "missing question section");
* if the first RR in the answer section is not a SOA record.
*/
if (xfr->reqtype == dns_rdatatype_ixfr &&
- atomic_load(&xfr->state) == XFRST_INITIALSOA &&
+ atomic_load(&xfr->state) == XFRST_ZONEXFRREQUEST &&
msg->counts[DNS_SECTION_ANSWER] == 0)
{
xfrin_log(xfr, ISC_LOG_DEBUG(3),
switch (atomic_load(&xfr->state)) {
case XFRST_GOTSOA:
xfr->reqtype = dns_rdatatype_axfr;
- atomic_store(&xfr->state, XFRST_INITIALSOA);
+ atomic_store(&xfr->state, XFRST_ZONEXFRREQUEST);
CHECK(xfrin_send_request(xfr));
break;
case XFRST_AXFR_END: