2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

3130. [func] Support alternate methods for managing a dynamic

zone's serial number.  Two methods are currently
                        defined using serial-update-method, "increment"
                        (default) and "unixtime".  [RT #23849]
This commit is contained in:
Mark Andrews
2011-07-01 02:25:48 +00:00
parent 923fba44d3
commit a69070d8fa
20 changed files with 303 additions and 50 deletions

28
lib/dns/update.c Normal file
View File

@@ -0,0 +1,28 @@
/*
* Copyright
*/
#include "config.h"
#include <isc/stdtime.h>
#include <isc/serial.h>
#include <dns/update.h>
isc_uint32_t
dns_update_soaserial(isc_uint32_t serial, dns_updatemethod_t method) {
isc_stdtime_t now;
if (method == dns_updatemethod_unixtime) {
isc_stdtime_get(&now);
if (now != 0 && isc_serial_gt(now, serial))
return (now);
}
/* RFC1982 */
serial = (serial + 1) & 0xFFFFFFFF;
if (serial == 0)
serial = 1;
return (serial);
}