From 89a1d7f2973d73bef3416c92d065fd3c7ad68472 Mon Sep 17 00:00:00 2001 From: chenlinghy Date: Mon, 18 Jan 2021 14:38:30 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=E4=BF=AE=E6=94=B9=E8=BF=AA?= =?UTF-8?q?=E6=99=AE=E8=AE=BE=E5=A4=87=E6=8B=86=E5=88=86IP=E7=9A=84?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dispose/ability/impl/DpTechBypassAbilityImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java index 2db46e3c..5aa597ac 100644 --- a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java +++ b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java @@ -255,10 +255,16 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { // 将业务Ip根据IP地址类型进行拆分 for (String k : StringUtils.deleteWhitespace(v.getServiceIp()).split(DisposeConfigValue.SPLIT_CHAR)) { + String ipValue = k.replaceAll("\\d+_", ""); + if (!k.contains(":")) { - ipV4.add(ipV4Idx++ + "_" + k); + if (Pattern.matches(ConstValue.ipAddrSegmentReg(), ipValue)) { + ipV4.add(ipV4Idx++ + "_" + ipValue); + } } else { - ipV6.add(ipV6Idx++ + "_" + k); + if (Pattern.matches(ConstValue.ipAddrSegmentReg(), ipValue)) { + ipV6.add(ipV6Idx++ + "_" + ipValue); + } } }