fw: instantiate strategy of next higher version
When an exact strategy version is unavailable, strategy registry now
instantiates the next higher version which can offer backwards compatibility.
All existing strategies do not support other versions.
refs #3868
Change-Id: Id2cf9ae3a1fa078ce8be815eea9396f5aa81ecbb
diff --git a/daemon/fw/client-control-strategy.cpp b/daemon/fw/client-control-strategy.cpp
index 8c99db2..b4bb601 100644
--- a/daemon/fw/client-control-strategy.cpp
+++ b/daemon/fw/client-control-strategy.cpp
@@ -39,6 +39,10 @@
if (!parsed.parameters.empty()) {
BOOST_THROW_EXCEPTION(std::invalid_argument("ClientControlStrategy does not accept parameters"));
}
+ if (parsed.version && *parsed.version != getStrategyName()[-1].toVersion()) {
+ BOOST_THROW_EXCEPTION(std::invalid_argument(
+ "ClientControlStrategy does not support version " + std::to_string(*parsed.version)));
+ }
this->setInstanceName(makeInstanceName(name, getStrategyName()));
NFD_LOG_WARN("NextHopFaceId field is honored universally and "