Merge remote branch
This commit is contained in:
@ -68,7 +68,6 @@ func (p *Port) matchPortReal(portRef string) bool {
|
||||
}
|
||||
|
||||
func NewPort(port string, adapter string, isSource bool, ruleExtra *C.RuleExtra) (*Port, error) {
|
||||
//the port format should be like this: "123/136/137-139" or "[123]/[136-139]"
|
||||
ports := strings.Split(port, "/")
|
||||
if len(ports) > 28 {
|
||||
return nil, fmt.Errorf("%s, too many ports to use, maximum support 28 ports", errPayload.Error())
|
||||
@ -93,7 +92,6 @@ func NewPort(port string, adapter string, isSource bool, ruleExtra *C.RuleExtra)
|
||||
|
||||
if subPortsLen == 1 {
|
||||
portList = append(portList, portReal{portStart, -1})
|
||||
|
||||
} else if subPortsLen == 2 {
|
||||
portEnd, err1 := strconv.Atoi(strings.Trim(subPorts[1], "[ ]"))
|
||||
if err1 != nil || portEnd < 0 || portEnd > 65535 {
|
||||
|
Reference in New Issue
Block a user