diff --git a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java index 22925006..67810caa 100644 --- a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java +++ b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java @@ -507,6 +507,8 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { // 判断防护IP段是否有变化 if (IpAddrType.IPV4.equals(t)) { if (ipV4.size() != dp.getIpSegment().values().size()) { + upgradeIpSegment = true; + } else { List ipList = ipV4.stream().map(k -> k.replaceAll("\\d+_", "")).collect(Collectors.toList()); @@ -516,12 +518,16 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { } } } else if (IpAddrType.IPV6.equals(t)) { - List ipList = - ipV6.stream().map(k -> k.replaceAll("\\d+_", "")).collect(Collectors.toList()); - - if (!ipList.containsAll(dp.getIpSegment().values()) - || !dp.getIpSegment().values().containsAll(ipList)) { + if (ipV6.size() != dp.getIpSegment().values().size()) { upgradeIpSegment = true; + } else { + List ipList = + ipV6.stream().map(k -> k.replaceAll("\\d+_", "")).collect(Collectors.toList()); + + if (!ipList.containsAll(dp.getIpSegment().values()) + || !dp.getIpSegment().values().containsAll(ipList)) { + upgradeIpSegment = true; + } } }