ip sort and fix bug

This commit is contained in:
Hossin Asaadi
2022-11-04 09:08:46 -04:00
parent 87b301cea6
commit d564956134

View File

@@ -15,7 +15,7 @@ import (
"time"
"net"
"github.com/go-cmd/cmd"
"sort"
)
type CheckClientIpJob struct {
@@ -176,12 +176,13 @@ func GetInboundClientIps(clientEmail string, ips []string) *model.InboundClientI
if(limitIp < len(ips) && limitIp != 0 && inbound.Enable) {
if(limitIp == 1){
limitIp = 0
limitIp = 2
}
disAllowedIps = append(disAllowedIps,ips[limitIp:]...)
disAllowedIps = append(disAllowedIps,ips[limitIp - 1:]...)
}
logger.Debug("disAllowedIps ",disAllowedIps)
sort.Sort(sort.StringSlice(disAllowedIps))
return inboundClientIps
}