### (Re)start
-When Fort validator is run for the first time, the RTR server will wait for router connections at [`--server.address`](usage.html#--serveraddress):[`--server.port`](usage.html#--serverport) and will start its first validation cycle.
+When Fort validator is run for the first time, the RTR server will listen for router connections at [`--server.address`](usage.html#--serveraddress):[`--server.port`](usage.html#--serverport) once its first validation cycle ends.
-If a router establishes a connection with Fort before the first validation cycle ends, Fort will respond with a **"No Data Available"** RTR error, causing the router to wait some time (this will depend on each router) before asking for updates again.
+If a router tries to establish a connection with Fort before the first validation cycle ends, Fort won't respond at all, causing the router to wait some time (this will depend on each router) before asking for updates again.
Once FORT validator ends its first validation cycle, it will share the resulting data (also known as "Validated ROA Payloads" or VRPs) with any router that establishes an RTR connection.
int error;
do {
+ sleep(config_get_validation_interval());
+
error = vrps_update(&changed);
if (error == -EINTR)
break; /* Process interrupted, terminate thread */
if (error) {
- pr_err("Error code %d while trying to update the ROA database. Sleeping...",
- error);
- goto sleep;
+ pr_err("Error while trying to update the ROA database. Sleeping...");
+ continue;
}
if (changed) {
error = notify_clients();
if (error)
- pr_debug("Could not notify clients of the new VRPs. (Error code %d.) Sleeping...",
+ pr_debug("Could't notify clients of the new VRPs. (Error code %d.) Sleeping...",
error);
else
pr_debug("Database updated successfully. Sleeping...");
}
-
-sleep:
- sleep(config_get_validation_interval());
} while (true);
return NULL;
int
updates_daemon_start(void)
{
+ bool changed;
+ int error;
+
+ error = vrps_update(&changed);
+ if (error)
+ return pr_err("First validation wasn't successful.");
+
errno = pthread_create(&thread, NULL, check_vrps_updates, NULL);
if (errno)
return -pr_errno(errno,