Rate limit getchallenge
This commit is contained in:
parent
2937ac7661
commit
7b15415042
3 changed files with 39 additions and 20 deletions
|
@ -67,6 +67,20 @@ void SV_GetChallenge(netadr_t from)
|
|||
return;
|
||||
}
|
||||
|
||||
// Prevent using getchallenge as an amplifier
|
||||
if ( SVC_RateLimitAddress( from, 10, 1000 ) ) {
|
||||
Com_DPrintf( "SV_GetChallenge: rate limit from %s exceeded, dropping request\n",
|
||||
NET_AdrToString( from ) );
|
||||
return;
|
||||
}
|
||||
|
||||
// Allow getchallenge to be DoSed relatively easily, but prevent
|
||||
// excess outbound bandwidth usage when being flooded inbound
|
||||
if ( SVC_RateLimit( &outboundLeakyBucket, 10, 100 ) ) {
|
||||
Com_DPrintf( "SV_GetChallenge: rate limit exceeded, dropping request\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
gameName = Cmd_Argv(2);
|
||||
|
||||
#ifdef LEGACY_PROTOCOL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue