Report accepted NOTIFY requests including serial.
[RT# 33037]
+3589. [func] Report serial numbers in when starting zone transfers.
+ Report accepted NOTIFY requests including serial.
+ [RT# 33037]
+
3588. [bug] dig: addressed a memory leak in the sigchase code
that could cause a shutdown crash. [RT #33733]
char keyname[DNS_NAME_FORMATSIZE];
isc_boolean_t is_poll = ISC_FALSE;
isc_boolean_t is_dlz = ISC_FALSE;
+ isc_boolean_t is_ixfr = ISC_FALSE;
+ isc_uint32_t begin_serial = 0, current_serial;
switch (reqtype) {
case dns_rdatatype_axfr:
CHECK(dns_db_createsoatuple(db, ver, mctx, DNS_DIFFOP_EXISTS,
¤t_soa_tuple));
+ current_serial = dns_soa_getserial(¤t_soa_tuple->rdata);
if (reqtype == dns_rdatatype_ixfr) {
- isc_uint32_t begin_serial, current_serial;
isc_boolean_t provide_ixfr;
/*
"IXFR request missing SOA");
begin_serial = dns_soa_getserial(&soa_rdata);
- current_serial = dns_soa_getserial(¤t_soa_tuple->rdata);
/*
* RFC1995 says "If an IXFR query with the same or
goto axfr_fallback;
}
CHECK(result);
+ is_ixfr = ISC_TRUE;
} else {
axfr_fallback:
- CHECK(axfr_rrstream_create(mctx, db, ver,
- &data_stream));
+ CHECK(axfr_rrstream_create(mctx, db, ver, &data_stream));
}
/*
xfrout_log1(client, question_name, question_class,
ISC_LOG_DEBUG(1), "IXFR poll up to date%s%s",
(xfr->tsigkey != NULL) ? ": TSIG " : "", keyname);
+ else if (is_ixfr)
+ xfrout_log1(client, question_name, question_class,
+ ISC_LOG_INFO, "%s started%s%s (serial %u -> %u)",
+ mnemonic, (xfr->tsigkey != NULL) ? ": TSIG " : "",
+ keyname, begin_serial, current_serial);
else
xfrout_log1(client, question_name, question_class,
- ISC_LOG_INFO, "%s started%s%s", mnemonic,
- (xfr->tsigkey != NULL) ? ": TSIG " : "", keyname);
+ ISC_LOG_INFO, "%s started%s%s (serial %u)",
+ mnemonic, (xfr->tsigkey != NULL) ? ": TSIG " : "",
+ keyname, current_serial);
/*
* Hand the context over to sendstream(). Set xfr to NULL;
kill -HUP `cat ns2/named.pid`
sleep 45
+n=`expr $n + 1`
+echo "I:checking notify message was logged ($n)"
+ret=0
+grep 'notify from 10.53.0.2#[0-9][0-9]*: serial 2$' ns3/named.run > /dev/null || ret=1
+[ $ret = 0 ] || echo "I:failed"
+status=`expr $ret + $status`
+
n=`expr $n + 1`
echo "I:checking example2 loaded ($n)"
ret=0
sleep 45
+n=`expr $n + 1`
+echo "I:checking notify message was logged ($n)"
+ret=0
+grep 'notify from 10.53.0.2#[0-9][0-9]*: serial 4$' ns3/named.run > /dev/null || ret=1
+[ $ret = 0 ] || echo "I:failed"
+status=`expr $ret + $status`
+
n=`expr $n + 1`
echo "I:checking example4 loaded ($n)"
ret=0
int match = 0;
isc_netaddr_t netaddr;
isc_sockaddr_t local, remote;
+ isc_uint32_t serial = 0;
+ isc_boolean_t have_serial = ISC_FALSE;
REQUIRE(DNS_ZONE_VALID(zone));
if (result == ISC_R_SUCCESS)
result = dns_rdataset_first(rdataset);
if (result == ISC_R_SUCCESS) {
- isc_uint32_t serial = 0, oldserial;
+ isc_uint32_t oldserial;
unsigned int soacount;
dns_rdataset_current(rdataset, &rdata);
result = dns_rdata_tostruct(&rdata, &soa, NULL);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
serial = soa.serial;
+ have_serial = ISC_TRUE;
/*
* The following should safely be performed without DB
* lock and succeed in this context.
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NEEDREFRESH);
zone->notifyfrom = *from;
UNLOCK_ZONE(zone);
- dns_zone_log(zone, ISC_LOG_INFO,
- "notify from %s: refresh in progress, "
- "refresh check queued",
- fromtext);
+ if (have_serial)
+ dns_zone_log(zone, ISC_LOG_INFO,
+ "notify from %s: serial %u: refresh in "
+ "progress, refresh check queued",
+ fromtext, serial);
+ else
+ dns_zone_log(zone, ISC_LOG_INFO,
+ "notify from %s: refresh in progress, "
+ "refresh check queued", fromtext);
return (ISC_R_SUCCESS);
}
+ if (have_serial)
+ dns_zone_log(zone, ISC_LOG_INFO, "notify from %s: serial %u",
+ fromtext, serial);
+ else
+ dns_zone_log(zone, ISC_LOG_INFO, "notify from %s: no serial",
+ fromtext);
zone->notifyfrom = *from;
local = zone->masteraddr;
remote = zone->sourceaddr;