summaryrefslogtreecommitdiff
path: root/source/sv_main.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2010-09-07 17:20:02 +0000
committerAndrey Nazarov <skuller@skuller.net>2010-09-07 17:20:02 +0000
commit648441f3eaa66a640e2372c7bfda4dc3bba487e4 (patch)
treeb76dd6c96f8cf87629ab908ec0fc4258ced380f9 /source/sv_main.c
parent8f76ac32949a283e000b27f6acd4359aa5de1806 (diff)
Added ‘(add|del|list)blackhole(s)’ commands for ignoring connectionless packets from IP blocks.
Diffstat (limited to 'source/sv_main.c')
-rw-r--r--source/sv_main.c8
1 files changed, 7 insertions, 1 deletions
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 ) {