s4:dns_server: use .wType = DNS_TYPE_TOMBSTONE instead of ZERO_STRUCT()
authorStefan Metzmacher <metze@samba.org>
Thu, 31 Jul 2014 07:32:00 +0000 (09:32 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 10 Mar 2015 09:55:42 +0000 (10:55 +0100)
The result is the same, but it is clearer.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 3ff025a02cca3ff209668edd419d0e440e9865c6)

source4/dns_server/dns_update.c

index a82303b424b0ed6646f483cbaac837594e80d64f..0906c2aaff72433a13e54ac7af33dd47a53ad991 100644 (file)
@@ -518,7 +518,9 @@ static WERROR handle_one_update(struct dns_server *dns,
                                        continue;
                                }
 
-                               ZERO_STRUCT(recs[i]);
+                               recs[i] = (struct dnsp_DnssrvRpcRecord) {
+                                       .wType = DNS_TYPE_TOMBSTONE,
+                               };
                        }
 
                        werror = dns_replace_records(dns, mem_ctx, dn,
@@ -567,12 +569,16 @@ static WERROR handle_one_update(struct dns_server *dns,
                                                continue;
                                        }
 
-                                       ZERO_STRUCT(recs[i]);
+                                       recs[i] = (struct dnsp_DnssrvRpcRecord) {
+                                               .wType = DNS_TYPE_TOMBSTONE,
+                                       };
                                }
 
                        } else {
                                for (i = 0; i < rcount; i++) {
-                                       ZERO_STRUCT(recs[i]);
+                                       recs[i] = (struct dnsp_DnssrvRpcRecord) {
+                                               .wType = DNS_TYPE_TOMBSTONE,
+                                       };
                                }
                        }
 
@@ -588,7 +594,9 @@ static WERROR handle_one_update(struct dns_server *dns,
                }
                for (i = 0; i < rcount; i++) {
                        if (recs[i].wType == update->rr_type) {
-                               ZERO_STRUCT(recs[i]);
+                               recs[i] = (struct dnsp_DnssrvRpcRecord) {
+                                       .wType = DNS_TYPE_TOMBSTONE,
+                               };
                        }
                }
 
@@ -632,7 +640,9 @@ static WERROR handle_one_update(struct dns_server *dns,
 
                for (i = 0; i < rcount; i++) {
                        if (dns_records_match(del_rec, &recs[i])) {
-                               ZERO_STRUCT(recs[i]);
+                               recs[i] = (struct dnsp_DnssrvRpcRecord) {
+                                       .wType = DNS_TYPE_TOMBSTONE,
+                               };
                        }
                }