mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-07 03:40:09 +00:00
Only send new format netconf for PV>=6
This commit is contained in:
parent
523ea68ae2
commit
2885aea65c
@ -2134,12 +2134,17 @@ NetworkController::ResultCode SqliteNetworkController::_doNetworkConfigRequest(c
|
|||||||
return NETCONF_QUERY_INTERNAL_SERVER_ERROR;
|
return NETCONF_QUERY_INTERNAL_SERVER_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// First append the legacy dictionary and a terminating NULL, then serialize the new-format one.
|
// Append legacy network config data for older devices
|
||||||
// Newer clients will use the new-format dictionary and older ones will use the old one.
|
if (metaData.protocolVersion < 6) {
|
||||||
std::string legacyStr(legacy.toString());
|
std::string legacyStr(legacy.toString());
|
||||||
netconf.append((const void *)legacyStr.data(),(unsigned int)legacyStr.length());
|
netconf.append((const void *)legacyStr.data(),(unsigned int)legacyStr.length());
|
||||||
|
}
|
||||||
netconf.append((uint8_t)0);
|
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;
|
return NetworkController::NETCONF_QUERY_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user