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:
28
lib/dns/update.c
Normal file
28
lib/dns/update.c
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user