]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dnsserver_common: comments about record sorting
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 1 Apr 2021 01:24:23 +0000 (14:24 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 5 Jul 2021 04:16:34 +0000 (04:16 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dns_server/dnsserver_common.c

index 02f958b3c082779978d796960c1acfb31480bc9e..30c1db6bee9d2ecdf774862071195d000ff79ed8 100644 (file)
@@ -637,13 +637,16 @@ static int rec_cmp(const struct dnsp_DnssrvRpcRecord *r1,
 {
        if (r1->wType != r2->wType) {
                /*
-                * The records are sorted with higher types first
+                * The records are sorted with higher types first,
+                * which puts tombstones (type 0) last.
                 */
                return r2->wType - r1->wType;
        }
-
        /*
-        * Then we need to sort from the oldest to newest timestamp
+        * Then we need to sort from the oldest to newest timestamp.
+        *
+        * Note that dwTimeStamp == 0 (never expiring) records come first,
+        * then the ones whose expiry is soonest.
         */
        return r1->dwTimeStamp - r2->dwTimeStamp;
 }