diff options
| author | Joseph Henry <[email protected]> | 2017-05-30 13:11:43 -0700 |
|---|---|---|
| committer | Joseph Henry <[email protected]> | 2017-05-30 13:11:43 -0700 |
| commit | 673d1b9a095025368177088bbf6875d7d3057f2f (patch) | |
| tree | 3291ad3a81fb076055e7bf173b5766ccdca675be /zto/node/NetworkConfig.cpp | |
| parent | 5cfb4c38ef2ab3a3621bf568db6bb2b2bd83a357 (diff) | |
updated ZTO core1.1.2
Diffstat (limited to 'zto/node/NetworkConfig.cpp')
| -rw-r--r-- | zto/node/NetworkConfig.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/zto/node/NetworkConfig.cpp b/zto/node/NetworkConfig.cpp index 9effe52..c39f6ca 100644 --- a/zto/node/NetworkConfig.cpp +++ b/zto/node/NetworkConfig.cpp @@ -51,6 +51,7 @@ bool NetworkConfig::toDictionary(Dictionary<ZT_NETWORKCONFIG_DICT_CAPACITY> &d,b if (!d.add(ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_LIMIT,(uint64_t)this->multicastLimit)) return false; if (!d.add(ZT_NETWORKCONFIG_DICT_KEY_TYPE,(uint64_t)this->type)) return false; if (!d.add(ZT_NETWORKCONFIG_DICT_KEY_NAME,this->name)) return false; + if (!d.add(ZT_NETWORKCONFIG_DICT_KEY_MTU,(uint64_t)this->mtu)) return false; #ifdef ZT_SUPPORT_OLD_STYLE_NETCONF if (includeLegacy) { @@ -217,6 +218,12 @@ bool NetworkConfig::fromDictionary(const Dictionary<ZT_NETWORKCONFIG_DICT_CAPACI this->multicastLimit = (unsigned int)d.getUI(ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_LIMIT,0); d.get(ZT_NETWORKCONFIG_DICT_KEY_NAME,this->name,sizeof(this->name)); + this->mtu = (unsigned int)d.getUI(ZT_NETWORKCONFIG_DICT_KEY_MTU,ZT_DEFAULT_MTU); + if (this->mtu < 1280) + this->mtu = 1280; // minimum MTU allowed by IPv6 standard and others + else if (this->mtu > ZT_MAX_MTU) + this->mtu = ZT_MAX_MTU; + if (d.getUI(ZT_NETWORKCONFIG_DICT_KEY_VERSION,0) < 6) { #ifdef ZT_SUPPORT_OLD_STYLE_NETCONF char tmp2[1024]; |
