rib: fix logic bug in config file validation

Closes: https://github.com/named-data/NFD/pull/9
Change-Id: I3b7c53c475098ec83fd469ceb40a306dfcd80cf3
This commit is contained in:
Jongseok Lee authored and Davide Pesavento committed 2020-03-10 20:23:02 -04:00
1 parent 32f7eac7cd
commit 854866f424
2 files changed
+8 -3

No files matched your search

+1
View File
@@ -19,6 +19,7 @@ If you would like to become a contributor to the official repository, please fol
* Nick Gordon <https://github.com/gorgonical>
* Giulio Grassi <https://www.lip6.fr/actualite/personnes-fiche.php?ident=D1461>
* Yi Huang <https://www.linkedin.com/in/yihuang1991>
* Jongseok Lee <https://github.com/imwhiz>
* Spencer Lee <https://www.linkedin.com/in/spenlee>
* Vince Lehman <http://vslehman.com>
* Yanbiao Li <https://www.linkedin.com/pub/yanbiao-li/24/7a1/4ba>
+7 -3
View File
@@ -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 @@ Service::checkConfig(const ConfigSection& section, const std::string& filename)
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);
}