rib: fix logic bug in config file validation
Closes: https://github.com/named-data/NFD/pull/9
Change-Id: I3b7c53c475098ec83fd469ceb40a306dfcd80cf3
diff --git a/daemon/rib/service.cpp b/daemon/rib/service.cpp
index f7b4719..d9e5bc5 100644
--- a/daemon/rib/service.cpp
+++ b/daemon/rib/service.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2020, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -167,8 +167,12 @@
for (const auto& item : section) {
const std::string& key = item.first;
const ConfigSection& value = item.second;
- if (key == CFG_LOCALHOST_SECURITY || key == CFG_LOCALHOP_SECURITY || key == CFG_PA_VALIDATION) {
- hasLocalhop = key == CFG_LOCALHOP_SECURITY;
+ if (key == CFG_LOCALHOST_SECURITY || key == CFG_PA_VALIDATION) {
+ ndn::ValidatorConfig testValidator(m_face);
+ testValidator.load(value, filename);
+ }
+ else if (key == CFG_LOCALHOP_SECURITY) {
+ hasLocalhop = true;
ndn::ValidatorConfig testValidator(m_face);
testValidator.load(value, filename);
}