diff options
Diffstat (limited to 'node/NetworkConfig.hpp')
-rw-r--r-- | node/NetworkConfig.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/node/NetworkConfig.hpp b/node/NetworkConfig.hpp index c3cc9cd4..0ed7b6a2 100644 --- a/node/NetworkConfig.hpp +++ b/node/NetworkConfig.hpp @@ -133,8 +133,12 @@ public: inline bool permitsEtherType(unsigned int etherType) const { for(unsigned int i=0;i<_ruleCount;++i) { - if ((_rules[i].etherType < 0)||((unsigned int)_rules[i].etherType == etherType)) - return (_rules[i].action == ZT_NETWORK_RULE_ACTION_ACCEPT); + if ((ZT_VirtualNetworkRuleMatches)_rules[i].matches == ZT_NETWORK_RULE_MATCHES_ETHERTYPE) { + if (_rules[i].datum.etherType == etherType) + return ((ZT_VirtualNetworkRuleAction)_rules[i].action == ZT_NETWORK_RULE_ACTION_ACCEPT); + } else if ((ZT_VirtualNetworkRuleMatches)_rules[i].matches == ZT_NETWORK_RULE_MATCHES_ALL) { + return ((ZT_VirtualNetworkRuleAction)_rules[i].action == ZT_NETWORK_RULE_ACTION_ACCEPT); + } } return false; } |