diff --git a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java index 2ae035af..ef9f2da9 100644 --- a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java +++ b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java @@ -427,10 +427,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); + } } }