From 86b82556d49313a7c28a5c88888aea11bf400c73 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Wed, 20 Jan 2021 17:20:31 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E4=BF=AE=E6=94=B9=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1IP=E5=92=8C=E9=98=B2=E6=8A=A4=E5=AF=B9=E8=B1=A1IP?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=AF=94=E8=BE=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ability/impl/DpTechBypassAbilityImpl.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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; + } } }