// to self. We should also accept here instead of interpreting
// REDIRECT as DROP since we are the destination.
#ifdef ZT_RULES_ENGINE_DEBUGGING
_dumpFilterTrace(_rtn(rt),thisSetMatches,noRedirect,inbound,ztSource,ztDest,macSource,macDest,dlog,frameLen,etherType,"ignored since we are the destination");
dlog.clear();
#endif // ZT_RULES_ENGINE_DEBUGGING
thisSetMatches=1;
@ -188,41 +229,22 @@ static int _doZtFilter(
}
if(rt==ZT_NETWORK_RULE_ACTION_REDIRECT){
#ifdef ZT_RULES_ENGINE_DEBUGGING
_dumpFilterTrace("ACTION_REDIRECT",thisSetMatches,noRedirect,inbound,ztSource,ztDest,macSource,macDest,dlog,frameLen,etherType,(noRedirect)?"second-pass match, not actually redirecting":(constchar*)0);
#endif // ZT_RULES_ENGINE_DEBUGGING
return-1;// match, drop packet (we redirected it)
}else{
#ifdef ZT_RULES_ENGINE_DEBUGGING
_dumpFilterTrace("ACTION_TEE",thisSetMatches,noRedirect,inbound,ztSource,ztDest,macSource,macDest,dlog,frameLen,etherType,(noRedirect)?"second-pass match, not actually teeing":(constchar*)0);
dlog.clear();
#endif // ZT_RULES_ENGINE_DEBUGGING
thisSetMatches=1;// TEE does not terminate evaluation
}
}
}continue;
caseZT_NETWORK_RULE_ACTION_DEBUG_LOG:
caseZT_NETWORK_RULE_ACTION_DEBUG_LOG:// a no-op target specifically for debugging purposes
thisSetMatches=1;// DEBUG_LOG does not terminate evaluation
@ -458,7 +480,9 @@ static int _doZtFilter(
}
}break;
default:continue;
default:// rules we don't know do not match -- this means upgrading may be necessary before shipping new rules on a network or old clients might get blocked
thisRuleMatches=0;
break;
}
// thisSetMatches remains true if the current rule matched (or did NOT match if NOT bit is set)