dns_ssutable_t *table = NULL;
isc_mem_t *mctx = dns_zone_getmctx(zone);
bool autoddns = false;
- isc_result_t result;
+ isc_result_t result = ISC_R_SUCCESS;
(void)cfg_map_get(zconfig, "update-policy", &updatepolicy);
updatepolicy = NULL;
}
- result = dns_ssutable_create(mctx, &table);
- if (result != ISC_R_SUCCESS) {
- return (result);
- }
+ dns_ssutable_create(mctx, &table);
for (element = cfg_list_first(updatepolicy); element != NULL;
element = cfg_list_next(element))
}
INSIST(i == n);
- result = dns_ssutable_addrule(
- table, grant, dns_fixedname_name(&fident), mtype,
- dns_fixedname_name(&fname), n, types);
+ dns_ssutable_addrule(table, grant, dns_fixedname_name(&fident),
+ mtype, dns_fixedname_name(&fname), n,
+ types);
if (types != NULL) {
isc_mem_put(mctx, types, n * sizeof(*types));
}
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
}
/*
goto cleanup;
}
- result = dns_ssutable_addrule(
- table, true, named_g_server->session_keyname,
- dns_ssumatchtype_local, dns_zone_getorigin(zone), 1,
- &any);
-
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
+ dns_ssutable_addrule(table, true,
+ named_g_server->session_keyname,
+ dns_ssumatchtype_local,
+ dns_zone_getorigin(zone), 1, &any);
}
- result = ISC_R_SUCCESS;
dns_zone_setssutable(zone, table);
cleanup:
dns_zone_setadded(zone, true);
if (dlzdb->ssutable == NULL) {
- result = dns_ssutable_createdlz(dlzdb->mctx, &dlzdb->ssutable,
- dlzdb);
- if (result != ISC_R_SUCCESS) {
- goto cleanup;
- }
+ dns_ssutable_createdlz(dlzdb->mctx, &dlzdb->ssutable, dlzdb);
}
dns_zone_setssutable(zone, dlzdb->ssutable);
unsigned int max; /* maximum number of records allowed. */
} dns_ssuruletype_t;
-isc_result_t
+void
dns_ssutable_create(isc_mem_t *mctx, dns_ssutable_t **table);
/*%<
* Creates a table that will be used to store simple-secure-update rules.
*\li ISC_R_NOMEMORY
*/
-isc_result_t
+void
dns_ssutable_createdlz(isc_mem_t *mctx, dns_ssutable_t **tablep,
dns_dlzdb_t *dlzdatabase);
/*%<
* resources used by the table will be freed.
*/
-isc_result_t
+void
dns_ssutable_addrule(dns_ssutable_t *table, bool grant,
const dns_name_t *identity, dns_ssumatchtype_t matchtype,
const dns_name_t *name, unsigned int ntypes,
ISC_LIST(dns_ssurule_t) rules;
};
-isc_result_t
+void
dns_ssutable_create(isc_mem_t *mctx, dns_ssutable_t **tablep) {
dns_ssutable_t *table;
ISC_LIST_INIT(table->rules);
table->magic = SSUTABLEMAGIC;
*tablep = table;
- return (ISC_R_SUCCESS);
}
static inline void
}
}
-isc_result_t
+void
dns_ssutable_addrule(dns_ssutable_t *table, bool grant,
const dns_name_t *identity, dns_ssumatchtype_t matchtype,
const dns_name_t *name, unsigned int ntypes,
rule->magic = SSURULEMAGIC;
ISC_LIST_INITANDAPPEND(table->rules, rule, link);
-
- return (ISC_R_SUCCESS);
}
static inline bool
/*
* Create a specialised SSU table that points at an external DLZ database
*/
-isc_result_t
+void
dns_ssutable_createdlz(isc_mem_t *mctx, dns_ssutable_t **tablep,
dns_dlzdb_t *dlzdatabase) {
- isc_result_t result;
dns_ssurule_t *rule;
dns_ssutable_t *table = NULL;
REQUIRE(tablep != NULL && *tablep == NULL);
- result = dns_ssutable_create(mctx, &table);
- if (result != ISC_R_SUCCESS) {
- return (result);
- }
+ dns_ssutable_create(mctx, &table);
table->dlzdatabase = dlzdatabase;
ISC_LIST_INITANDAPPEND(table->rules, rule, link);
*tablep = table;
- return (ISC_R_SUCCESS);
}
isc_result_t