summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-06-07 11:13:18 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-06-07 11:13:18 -0700
commit2885aea65c0ad6d8337b7e3ae4f2e6099f3eedda (patch)
tree74fde57fa8c897b0907c8e7bff8467957885664d
parent523ea68ae2dc5c216d10ef75c024d84b31ada16c (diff)
downloadinfinitytier-2885aea65c0ad6d8337b7e3ae4f2e6099f3eedda.tar.gz
infinitytier-2885aea65c0ad6d8337b7e3ae4f2e6099f3eedda.zip
Only send new format netconf for PV>=6
-rw-r--r--controller/SqliteNetworkController.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/controller/SqliteNetworkController.cpp b/controller/SqliteNetworkController.cpp
index 4d75620d..a83807ca 100644
--- a/controller/SqliteNetworkController.cpp
+++ b/controller/SqliteNetworkController.cpp
@@ -2134,12 +2134,17 @@ NetworkController::ResultCode SqliteNetworkController::_doNetworkConfigRequest(c
return NETCONF_QUERY_INTERNAL_SERVER_ERROR;
}
- // First append the legacy dictionary and a terminating NULL, then serialize the new-format one.
- // Newer clients will use the new-format dictionary and older ones will use the old one.
- std::string legacyStr(legacy.toString());
- netconf.append((const void *)legacyStr.data(),(unsigned int)legacyStr.length());
+ // Append legacy network config data for older devices
+ if (metaData.protocolVersion < 6) {
+ std::string legacyStr(legacy.toString());
+ netconf.append((const void *)legacyStr.data(),(unsigned int)legacyStr.length());
+ }
netconf.append((uint8_t)0);
- nc.serialize(netconf);
+
+ // Append new format data for newer devices
+ if (metaData.protocolVersion >= 6) {
+ nc.serialize(netconf);
+ }
return NetworkController::NETCONF_QUERY_OK;
}