Implement review changes

This commit is contained in:
Patrick Pacher
2020-04-17 11:52:53 +02:00
parent 58ad3eb88b
commit ea3e327c27
4 changed files with 43 additions and 36 deletions

View File

@@ -141,16 +141,21 @@ func DecideOnConnection(conn *network.Connection, pkt packet.Packet) { //nolint:
}
}
// check for bypass protection
result, reason := p.MatchBypassProtection(conn.Entity)
switch result {
case endpoints.Denied:
conn.Block("bypass prevention: " + reason)
return
case endpoints.Permitted:
conn.Accept("bypass prevention: " + reason)
return
case endpoints.NoMatch:
var result endpoints.EPResult
var reason string
if p.PreventBypassing() {
// check for bypass protection
result, reason := PreventBypassing(conn)
switch result {
case endpoints.Denied:
conn.Block("bypass prevention: " + reason)
return
case endpoints.Permitted:
conn.Accept("bypass prevention: " + reason)
return
case endpoints.NoMatch:
}
}
// check endpoints list