+The segfaults where due to a bad initialization of visited URI elements and reference count.
+Add some debug logs when processing RRDP files.
+Replace 'Valid ROAs' label with 'Valid Prefixes' when there are updates at VRPS DB (and update docs where this label is referenced).
- `info`: Information deemed useful to the user:
- Configuration echo at the beginning.
- Server binding status.
- - Start and end of a validation cycle, including: number of valid ROAs and Router Keys, current serial number (only when [`--mode=server`](usage.html#--mode), and real execution time.
+ - Start and end of a validation cycle, including: number of valid Prefixes and Router Keys, current RTR serial number (only when [`--mode=server`](usage.html#--mode), and real execution time.
- SLURM version applied in case of a syntax error or invalid data at the newest loaded SLURM configured at [`--slurm`](usage.html#--slurm).
- RTR client connection accepted, closed or terminated.
- `debug`: Information deemed useful to the developer. Expect a lot of messages when utilized.
-.TH fort 8 "2019-11-08" "v1.2.0" "FORT validator"
+.TH fort 8 "2019-12-18" "v1.2.0" "FORT validator"
.SH NAME
fort \- RPKI certificate path validator and RTR server
curl_easy_setopt(handler->curl, CURLOPT_WRITEFUNCTION, cb);
curl_easy_setopt(handler->curl, CURLOPT_WRITEDATA, arg);
- pr_debug("HTTP GET from '%s'.", uri);
+ pr_debug("Doing HTTP GET to '%s'.", uri);
res = curl_easy_perform(handler->curl);
curl_easy_getinfo(handler->curl, CURLINFO_RESPONSE_CODE, response_code);
if (res == CURLE_OK)
return error;
/* No updates at the file (yet), didn't pushed to fnstack */
- if (upd_notification == NULL)
+ if (upd_notification == NULL) {
+ pr_debug("No updates yet at '%s'.", uri_get_global(uri));
return 0;
+ }
error = db_rrdp_uris_cmp(uri_get_global(uri),
upd_notification->global_data.session_id,
goto set_update;
case RRDP_URI_DIFF_SERIAL:
error = process_diff_serial(upd_notification, &visited);
- /* Something went wrong, use snapshot */
if (!error) {
visited_uris_refget(visited);
break;
}
+ /* Something went wrong, use snapshot */
pr_warn("There was an error processing RRDP deltas, using the snapshot instead.");
case RRDP_URI_DIFF_SESSION:
/* Delete the old session files */
/* Any change, and no error during the process, update db */
if (!error) {
+ pr_debug("Updating local RRDP data of '%s' to:",
+ uri_get_global(uri));
+ pr_debug("- Session ID: %s",
+ upd_notification->global_data.session_id);
+ pr_debug("- Serial: %lu",
+ upd_notification->global_data.serial);
error = db_rrdp_uris_update(uri_get_global(uri),
upd_notification->global_data.session_id,
upd_notification->global_data.serial,
set_update:
/* Set the last update to now */
+ pr_debug("Set last update of RRDP data of '%s' to now.",
+ uri_get_global(uri));
error = db_rrdp_uris_set_last_update(uri_get_global(uri));
end:
if (upd_notification != NULL) {
return -ENOENT;
}
+ pr_debug("Getting RRDP deltas from serial %lu to %lu.", from_serial,
+ max_serial);
from = deltas->capacity - (max_serial - from_serial);
for (index = from; index < deltas->capacity; index++) {
error = cb(deltas->array[index], arg);
return 0;
}
+/* Remove a local file and its directory tree (if empty) */
static int
delete_from_uri(struct rpki_uri *uri, struct visited_uris *visited_uris)
{
break;
}
- pr_info("- Valid ROAs: %u", db_table_roa_count(state.base));
+ pr_info("- Valid Prefixes: %u", db_table_roa_count(state.base));
pr_info("- Valid Router Keys: %u",
db_table_router_key_count(state.base));
if (config_get_mode() == SERVER) {
tmp = malloc(sizeof(struct visited_elem));
if (tmp == NULL)
return pr_enomem();
+ /* Needed by uthash */
+ memset(tmp, 0, sizeof(struct visited_elem));
tmp->uri = strdup(uri);
if (tmp->uri == NULL) {
return pr_enomem();
tmp->table = NULL;
- tmp->refs = 0;
+ tmp->refs = 1;
*uris = tmp;
return 0;
}
-
static void
visited_uris_destroy(struct visited_uris *uris)
{
visited_uris_refput(struct visited_uris *uris)
{
uris->refs--;
- if (uris->refs == 0) {
+ if (uris->refs == 0)
visited_uris_destroy(uris);
- }
}
static struct visited_elem *