Change "Invalid IP" msgs to info loglevel

This commit is contained in:
yo 2022-05-17 15:54:12 +02:00
parent 874b1c541a
commit 6e9947809c

View File

@ -26,7 +26,7 @@ import (
)
const (
version = "1.0.0-rc3"
version = "1.0.0-rc4"
)
var (
@ -227,7 +227,12 @@ func handleConnection(connClt net.Conn, conLdap *ldap.Conn) {
// First query netCache built with ipNetworkNumber
res, err := isIPContainedInNetCache(ip)
if err != nil {
logstream.Error(err.Error())
if strings.EqualFold(err.Error(), fmt.Sprintf("Invalid IP: %s", ip)) {
// We don't want those msg to pollute logs
logstream.Info(err.Error())
} else {
logstream.Error(err.Error())
}
sendResponse(connClt, err.Error(), 500)
continue
}