single dns config per network
This commit is contained in:
parent
058d888311
commit
c0c215c83c
9 changed files with 76 additions and 147 deletions
|
@ -177,12 +177,9 @@ bool NetworkConfig::toDictionary(Dictionary<ZT_NETWORKCONFIG_DICT_CAPACITY> &d,b
|
|||
}
|
||||
|
||||
tmp->clear();
|
||||
if (dnsCount > 0) {
|
||||
tmp->append(dnsCount);
|
||||
DNS::serializeDNS(*tmp, dns, dnsCount);
|
||||
if (tmp->size()) {
|
||||
if (!d.add(ZT_NETWORKCONFIG_DICT_KEY_DNS,*tmp)) return false;
|
||||
}
|
||||
DNS::serializeDNS(*tmp, &dns);
|
||||
if (tmp->size()) {
|
||||
if (!d.add(ZT_NETWORKCONFIG_DICT_KEY_DNS,*tmp)) return false;
|
||||
}
|
||||
|
||||
delete tmp;
|
||||
|
@ -366,9 +363,7 @@ bool NetworkConfig::fromDictionary(const Dictionary<ZT_NETWORKCONFIG_DICT_CAPACI
|
|||
|
||||
if (d.get(ZT_NETWORKCONFIG_DICT_KEY_DNS, *tmp)) {
|
||||
unsigned int p = 0;
|
||||
this->dnsCount = tmp->at<unsigned int>(p);
|
||||
p += sizeof(unsigned int);
|
||||
DNS::deserializeDNS(*tmp, p, dns, (this->dnsCount <= ZT_MAX_NETWORK_DNS) ? this->dnsCount : ZT_MAX_NETWORK_DNS);
|
||||
DNS::deserializeDNS(*tmp, p, &dns);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue