|
@@ -372,20 +372,21 @@ func (s *aidedWebService) FindDifferenceList(oldList, newList []v1.BackendList)
|
|
|
func (s *aidedWebService) WashDifferentIp(newIpList []string, oldIpList []string) (addedDenyIps []string, removedDenyIps []string) {
|
|
|
var newAllowIps []string
|
|
|
var oldAllowIps []string
|
|
|
- if len(oldIpList) > 0 {
|
|
|
- for _, v := range oldIpList {
|
|
|
- if net.ParseIP(v) != nil {
|
|
|
- oldAllowIps = append(oldAllowIps, v)
|
|
|
- }
|
|
|
+
|
|
|
+ // 获取旧IP列表
|
|
|
+ for _, v := range oldIpList {
|
|
|
+ if net.ParseIP(v) != nil {
|
|
|
+ oldAllowIps = append(oldAllowIps, v)
|
|
|
}
|
|
|
}
|
|
|
- if len(newIpList) > 0 {
|
|
|
- for _, v := range newIpList {
|
|
|
- if net.ParseIP(v) != nil {
|
|
|
- newAllowIps = append(newAllowIps, v)
|
|
|
- }
|
|
|
+
|
|
|
+ // 获取新IP列表
|
|
|
+ for _, v := range newIpList {
|
|
|
+ if net.ParseIP(v) != nil {
|
|
|
+ newAllowIps = append(newAllowIps, v)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
addedDenyIps, removedDenyIps = s.wafformatter.findIpDifferences(oldAllowIps, newAllowIps)
|
|
|
return addedDenyIps, removedDenyIps
|
|
|
}
|