Add and fix port range rules and update documentation for it

This commit is contained in:
Daniel
2021-10-13 17:34:48 +02:00
parent d0c1010311
commit 8a4ac913a1
3 changed files with 23 additions and 5 deletions

View File

@@ -154,6 +154,9 @@ func (ep *EndpointBase) parsePPP(typedEp Endpoint, fields []string) (Endpoint, e
return nil, invalidDefinitionError(fields, "port number parsing error")
}
}
if n16 == 0 {
return nil, invalidDefinitionError(fields, "port number cannot be 0")
}
ep.StartPort = n16
// parse end port
if len(portSplitted) > 1 {
@@ -167,6 +170,9 @@ func (ep *EndpointBase) parsePPP(typedEp Endpoint, fields []string) (Endpoint, e
}
}
}
if n16 == 0 {
return nil, invalidDefinitionError(fields, "port number cannot be 0")
}
ep.EndPort = n16
}
}

View File

@@ -26,7 +26,7 @@ func (r *reason) String() string {
prefix = "allowed by rule: "
}
return prefix + r.description + " " + r.Value
return prefix + r.description + " " + r.Filter[2:]
}
func (r *reason) Context() interface{} {