Implement review changes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user