Skip to content

Commit

Permalink
State "old-serial" for nsd-control
Browse files Browse the repository at this point in the history
As requested in Issue #419
"old-serial" is printed as state with nsd-control when the served serial is older than the one received by transfer.
Also, state "future-serial" is printed if the served serial is newer than the one received by transfer.
  • Loading branch information
wtoorop committed Jan 7, 2025
1 parent 2109449 commit 4987e39
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -1123,8 +1123,13 @@ print_zonestatus(RES* ssl, xfrd_state_type* xfrd, struct zone_options* zo)
return 1;
}
if(!ssl_printf(ssl, " state: %s\n",
(xz->state == xfrd_zone_ok)?"ok":(
(xz->state == xfrd_zone_expired)?"expired":"refreshing")))
xz->state == xfrd_zone_expired ? "expired"
: xz->state != xfrd_zone_ok ? "refreshing"
: !xz->soa_nsd_acquired || !xz->soa_disk_acquired
|| xz->soa_nsd.serial == xz->soa_disk.serial ? "ok"
: compare_serial( ntohl(xz->soa_nsd.serial)
, ntohl(xz->soa_disk.serial)) < 0 ? "old-serial"
: "future-serial"))
return 0;
if(!print_soa_status(ssl, "served-serial", &xz->soa_nsd,
xz->soa_nsd_acquired))
Expand Down

0 comments on commit 4987e39

Please sign in to comment.