From 648441f3eaa66a640e2372c7bfda4dc3bba487e4 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Tue, 7 Sep 2010 17:20:02 +0000 Subject: Added ‘(add|del|list)blackhole(s)’ commands for ignoring connectionless packets from IP blocks. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/sv_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/sv_main.c') diff --git a/source/sv_main.c b/source/sv_main.c index 35760d3..8171002 100644 --- a/source/sv_main.c +++ b/source/sv_main.c @@ -24,6 +24,7 @@ pmoveParams_t sv_pmp; LIST_DECL( sv_masterlist ); // address of group servers LIST_DECL( sv_banlist ); +LIST_DECL( sv_blacklist ); LIST_DECL( sv_cmdlist_connect ); LIST_DECL( sv_cmdlist_begin ); LIST_DECL( sv_filterlist ); @@ -1026,6 +1027,11 @@ static void SV_ConnectionlessPacket( void ) { int i; size_t len; + if( SV_MatchAddress( &sv_blacklist, &net_from ) ) { + Com_DPrintf( "ignored blackholed connectionless packet\n" ); + return; + } + MSG_BeginReading(); MSG_ReadLong(); // skip the -1 marker @@ -1193,7 +1199,7 @@ static void SV_PacketEvent( void ) { client_t *client; netchan_t *netchan; int qport; - + // check for connectionless packet (0xffffffff) first // connectionless packets are processed even if the server is down if( *( int * )msg_read.data == -1 ) { -- cgit v1.2.3