From 4d9b74b171d243abe2d2d6a0039865ece8a4a00c Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 4 Aug 2016 15:27:20 -0700 Subject: . --- node/Filter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'node/Filter.cpp') diff --git a/node/Filter.cpp b/node/Filter.cpp index 286a0144..b8b0bd2a 100644 --- a/node/Filter.cpp +++ b/node/Filter.cpp @@ -239,9 +239,10 @@ bool Filter::run( thisRuleMatches = 0; } break; - case ZT_NETWORK_RULE_MATCH_CHARACTERISTICS: - // TODO: not supported yet - break; + case ZT_NETWORK_RULE_MATCH_CHARACTERISTICS: { + uint64_t cf = (receiving) ? ZT_RULE_PACKET_CHARACTERISTICS_0_INBOUND : 0ULL; + thisRuleMatches = (uint8_t)((cf & rules[rn].v.characteristics[0]) == rules[rn].v.characteristics[1]); + } break; case ZT_NETWORK_RULE_MATCH_FRAME_SIZE_RANGE: thisRuleMatches = (uint8_t)((frameLen >= (unsigned int)rules[rn].v.frameSize[0])&&(frameLen <= (unsigned int)rules[rn].v.frameSize[1])); break; -- cgit v1.2.3