From 37afa876a72344fdfc8091db8d292af2f796c77c Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 17 Jun 2016 00:21:58 +0000 Subject: Linux bug fixes, small controller fix. --- controller/SqliteNetworkController.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'controller') diff --git a/controller/SqliteNetworkController.cpp b/controller/SqliteNetworkController.cpp index eee9b7c7..62808de0 100644 --- a/controller/SqliteNetworkController.cpp +++ b/controller/SqliteNetworkController.cpp @@ -1769,13 +1769,15 @@ NetworkController::ResultCode SqliteNetworkController::_doNetworkConfigRequest(c std::sort(allowedEtherTypes.begin(),allowedEtherTypes.end()); allowedEtherTypes.erase(std::unique(allowedEtherTypes.begin(),allowedEtherTypes.end()),allowedEtherTypes.end()); - for(long i=0,k=0;((i<(long)allowedEtherTypes.size())&&(k ZT_MAX_NETWORK_RULES) + break; if (allowedEtherTypes[i] > 0) { - nc.rules[k].t = ZT_NETWORK_RULE_MATCH_ETHERTYPE; - nc.rules[k].v.etherType = (uint16_t)allowedEtherTypes[i]; - ++k; + nc.rules[nc.ruleCount].t = ZT_NETWORK_RULE_MATCH_ETHERTYPE; + nc.rules[nc.ruleCount].v.etherType = (uint16_t)allowedEtherTypes[i]; + ++nc.ruleCount; } - nc.rules[k++].t = ZT_NETWORK_RULE_ACTION_ACCEPT; + nc.rules[nc.ruleCount++].t = ZT_NETWORK_RULE_ACTION_ACCEPT; } /* -- cgit v1.2.3