Commit 0d3bf5f1 authored by Jan Kadlec's avatar Jan Kadlec

Merge branch 'refresh' into '1.6'

Forced refresh fix

Fixes #303

See merge request !298
parents e25c49ed 7ed37ad8
......@@ -390,10 +390,6 @@ int axfr_answer_process(knot_pkt_t *pkt, struct answer_data *adata)
/* Initialize processing with first packet. */
if (adata->ext == NULL) {
NS_NEED_TSIG_SIGNED(&adata->param->tsig_ctx, 0);
if (!zone_transfer_needed(adata->param->zone, pkt)) {
AXFRIN_LOG(LOG_INFO, "zone is up-to-date");
return NS_PROC_DONE;
}
AXFRIN_LOG(LOG_INFO, "starting");
int ret = axfr_answer_init(adata);
......
......@@ -706,7 +706,8 @@ int ixfr_process_answer(knot_pkt_t *pkt, struct answer_data *adata)
if (adata->ext == NULL) {
NS_NEED_TSIG_SIGNED(&adata->param->tsig_ctx, 0);
if (!zone_transfer_needed(adata->param->zone, pkt)) {
IXFRIN_LOG(LOG_INFO, "server has newer zone");
IXFRIN_LOG(LOG_WARNING, "master sent older serial, "
"ignoring");
return NS_PROC_DONE;
}
......
$ORIGIN example.com.
$TTL 3600
@ SOA dns1 hostmaster 2010111201 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
dns1 A 192.0.2.1
AAAA 2001:DB8::1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
mail A 192.0.2.3
AAAA 2001:DB8::3
$ORIGIN example.com.
$TTL 3600
@ SOA dns1 hostmaster 2010111202 10800 3600 1209600 7200
NS dns1
NS dns2
MX 10 mail
dns1 A 192.0.2.1
AAAA 2001:DB8::1
dns2 A 192.0.2.2
AAAA 2001:DB8::2
mail A 192.0.2.3
AAAA 2001:DB8::3
new A 1.2.3.4
#!/usr/bin/env python3
'''Test for reload of a changed zone (serial up, nochange, serial down). '''
from dnstest.test import Test
from dnstest.utils import *
t = Test()
master = t.server("bind")
slave = t.server("knot")
zone = t.zone("example.com.", storage=".")
t.link(zone, master, slave)
# Load newer zone to the slave
slave.update_zonefile(zone, version=1)
t.start()
serial_master = master.zone_wait(zone)
serial_slave = slave.zone_wait(zone)
# Check that the slave's serial is larger than master's
assert serial_master <= serial_slave
# Force refresh
slave.ctl("-f refresh example.com.")
t.sleep(2)
serial_slave = slave.zone_wait(zone)
compare(serial_slave, serial_master, "Forced refresh")
t.end()
......@@ -997,7 +997,7 @@ class Knot(Server):
def ctl(self, params):
try:
check_call([self.control_bin] + self.start_params + params.split,
check_call([self.control_bin] + self.start_params + params.split(),
stdout=open(self.dir + "/call.out", mode="a"),
stderr=open(self.dir + "/call.err", mode="a"))
time.sleep(Server.START_WAIT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment