|
|
@@ -99,15 +99,17 @@ public interface AppRuleDriver { |
|
|
|
} |
|
|
|
|
|
|
|
static boolean isFlexRouteFqdn(RedisService redis, String ip, String fqdn) { |
|
|
|
final String key = REDIS_FLEX_LISTS + "~" + ip + REDIS_LIST_SUFFIX; |
|
|
|
|
|
|
|
final String excludeKey = REDIS_FLEX_EXCLUDE_LISTS + "~" + ip + REDIS_LIST_SUFFIX; |
|
|
|
if (redis.sismember_plaintext(excludeKey, fqdn)) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
final String key = REDIS_FLEX_LISTS + "~" + ip + REDIS_LIST_SUFFIX; |
|
|
|
String check = fqdn; |
|
|
|
while (true) { |
|
|
|
final boolean found = redis.sismember_plaintext(key, check); |
|
|
|
if (found) { |
|
|
|
final boolean excluded = redis.sismember_plaintext(excludeKey, check); |
|
|
|
if (!excluded) return true; |
|
|
|
} |
|
|
|
if (found) return true; |
|
|
|
final int dotPos = check.indexOf('.'); |
|
|
|
if (dotPos == check.length()) return false; |
|
|
|
check = check.substring(dotPos+1); |
|
|
|