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, 26 Aug 2014 07:13:06 +0000 (09:13 +0200)
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>
source4/dns_server/dns_update.c

index a589d63bc06cf7dce94c8138d644f741aa7dd249..4ff82b4c097ea7e109a05d6c6ef1a1e86d37ccd1 100644 (file)
@@ -521,7 +521,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,
@@ -570,12 +572,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,
+                                       };
                                }
                        }
 
@@ -591,7 +597,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,
+                               };
                        }
                }
 
@@ -635,7 +643,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,
+                               };
                        }
                }