summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2022-03-03 18:28:29 +0800
committerfengweihao <[email protected]>2022-03-03 18:28:29 +0800
commit421723f758325a237d557347b4eb63c0492c592b (patch)
treef00a3df8d0852e870c548f05c877cae35953a700
parent9ddc606ac5a62b9e6bbadfeb0f3495b4eea05e0b (diff)
TSG-9860 修复代理策略无法支持三级归属地命中v4.5.36-20220303release-4.5develop-4.5
-rw-r--r--common/src/tfe_scan.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/common/src/tfe_scan.cpp b/common/src/tfe_scan.cpp
index aa3feb5..d743cf4 100644
--- a/common/src/tfe_scan.cpp
+++ b/common/src/tfe_scan.cpp
@@ -186,14 +186,7 @@ int tfe_scan_ip_location(const struct tfe_stream *stream, struct Maat_rule_t *re
{
memset(buff, 0, sizeof(buff));
- if(strlen(dst_subdivsion))
- {
- snprintf(buff, sizeof(buff),"%s.%s.%s.%s.", dst_country, dst_provine, dst_city, dst_subdivsion);
- }
- else
- {
- snprintf(buff, sizeof(buff), "%s.%s.", dst_country, dst_city);
- }
+ snprintf(buff, sizeof(buff),"%s.%s.%s.%s.", dst_country, dst_provine, dst_city, dst_subdivsion);
scan_ret = Maat_full_scan_string(tfe_bussiness_resouce_get(STATIC_MAAT), tfe_bussiness_tableid_get(TABLE_SECURITY_DESTINATION_LOCATION),
CHARSET_GBK, buff, strlen(buff),
result + hit_cnt + hit_cnt_ip, NULL, MAX_SCAN_RESULT - hit_cnt - hit_cnt_ip,
@@ -223,14 +216,8 @@ int tfe_scan_ip_location(const struct tfe_stream *stream, struct Maat_rule_t *re
if (strlen(src_country) || strlen(src_city))
{
memset(buff, 0, sizeof(buff));
- if(strlen(src_subdivsion))
- {
- snprintf(buff, sizeof(buff), "%s.%s.%s.%s.", src_country, src_provine, src_city, src_subdivsion);
- }
- else
- {
- snprintf(buff, sizeof(buff), "%s.%s.", src_country, src_city);
- }
+
+ snprintf(buff, sizeof(buff), "%s.%s.%s.%s.", src_country, src_provine, src_city, src_subdivsion);
scan_ret = Maat_full_scan_string(tfe_bussiness_resouce_get(STATIC_MAAT), tfe_bussiness_tableid_get(TABLE_SECURITY_SOURCE_LOCATION),
CHARSET_GBK, buff, strlen(buff),
result + hit_cnt + hit_cnt_ip, NULL, MAX_SCAN_RESULT - hit_cnt - hit_cnt_ip,