parent
9d66b8784d
commit
495a73c005
|
@ -263,6 +263,25 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
return ipSegment + "-" + ipSegment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets ipv6 segment format.
|
||||
*
|
||||
* @param ipSegment the ipv6 segment
|
||||
* @return the ip segment format
|
||||
*/
|
||||
private String getIpV6SegmentFormat(String ipSegment) {
|
||||
if(ipSegment.contains(ConstValue.IPV6_SEGMENT_SPILT)){
|
||||
return ipSegment;
|
||||
}
|
||||
|
||||
//如果输入格式为IP-IP,则返回值为null
|
||||
if(ipSegment.contains(ConstValue.IPV6_ERR_SEGMENT_SPILT)){
|
||||
return null;
|
||||
}
|
||||
|
||||
return ipSegment + "/" + 128;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create traction strategy error code.
|
||||
*
|
||||
|
@ -482,7 +501,12 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
if (!k.contains(":")) {
|
||||
ipV4.add(ipV4Idx++ + "_" + getIpSegmentFormat(k));
|
||||
} else {
|
||||
ipV6.add(ipV6Idx++ + "_" + getIpSegmentFormat(k));
|
||||
if(getIpV6SegmentFormat(k) == null){
|
||||
log.error("!!!!ipV6:{} format error", k);
|
||||
return;
|
||||
}else{
|
||||
ipV6.add(ipV6Idx++ + "_" + getIpV6SegmentFormat(k));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,6 +94,16 @@ public class ConstValue {
|
|||
*/
|
||||
public static final String[] IP_SEGMENT_SPILT = new String[] {"-", "/"};
|
||||
|
||||
/**
|
||||
* The constant IPV6_ERR_SEGMENT_SPILT.
|
||||
*/
|
||||
public static final String IPV6_ERR_SEGMENT_SPILT = "-";
|
||||
|
||||
/**
|
||||
* The constant IPV6_SEGMENT_SPILT.
|
||||
*/
|
||||
public static final String IPV6_SEGMENT_SPILT = "/";
|
||||
|
||||
/**
|
||||
* The type Protocol.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue