sources: log error when local refid is unknown in orphan mode

This commit is contained in:
Miroslav Lichvar 2016-04-01 09:37:49 +02:00
parent da96d334ab
commit 6accd19eb3

View file

@ -731,13 +731,17 @@ SRC_SelectSource(SRC_Instance updated_inst)
} }
/* If no selectable source is available, consider the orphan source */ /* If no selectable source is available, consider the orphan source */
if (!n_sel_sources && orphan_source != INVALID_SOURCE && if (!n_sel_sources && orphan_source != INVALID_SOURCE) {
sources[orphan_source]->ref_id < uint32_t local_ref_id = NSR_GetLocalRefid(sources[orphan_source]->ip_addr);
NSR_GetLocalRefid(sources[orphan_source]->ip_addr)) {
sources[orphan_source]->status = SRC_OK; if (!local_ref_id) {
n_sel_sources = 1; LOG(LOGS_ERR, LOGF_Sources, "Unknown local refid in orphan mode");
DEBUG_LOG(LOGF_Sources, "selecting orphan refid=%"PRIx32, } else if (sources[orphan_source]->ref_id < local_ref_id) {
sources[orphan_source]->ref_id); sources[orphan_source]->status = SRC_OK;
n_sel_sources = 1;
DEBUG_LOG(LOGF_Sources, "selecting orphan refid=%"PRIx32,
sources[orphan_source]->ref_id);
}
} }
for (i = 0; i < n_sources; i++) { for (i = 0; i < n_sources; i++) {