summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2009-09-04 08:35:04 +0000
committerAndrey Nazarov <skuller@skuller.net>2009-09-04 08:35:04 +0000
commit36e7aedc1723b759b9b764f98bd1679bdcdec110 (patch)
tree02ad7cc1221cfaf73eeef8a7839a1b8539683960
parent3a11beb25a150a1782dd7bd427dbf1767ed0d196 (diff)
Don't allow adding duplicate address/mask entries to IP filter lists.
-rw-r--r--source/sv_ccmds.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/sv_ccmds.c b/source/sv_ccmds.c
index 9a02b49..8494a3d 100644
--- a/source/sv_ccmds.c
+++ b/source/sv_ccmds.c
@@ -780,7 +780,7 @@ static qboolean SV_ParseMask( const char *s, uint32_t *addr, uint32_t *mask ) {
if( p ) {
*p++ = 0;
if( *p == 0 ) {
- Com_Printf( "Please specify a mask.\n" );
+ Com_Printf( "Please specify a mask after '/'.\n" );
return qfalse;
}
bits = atoi( p );
@@ -818,14 +818,12 @@ void SV_AddMatch_f( list_t *list ) {
return;
}
-#if 0
LIST_FOR_EACH( addrmatch_t, match, list, entry ) {
- if( ( match->addr & match->mask ) == ( addr & mask ) ) {
- Com_Printf( "Address already matches.\n" );
+ if( match->addr == addr && match->mask == mask ) {
+ Com_Printf( "Address/mask entry %s already exists.\n", s );
return;
}
}
-#endif
s = Cmd_ArgsFrom( 2 );
len = strlen( s );
@@ -895,7 +893,7 @@ remove:
return;
}
}
- Com_Printf( "No such address/mask: %s\n", s );
+ Com_Printf( "No such address/mask entry: %s\n", s );
}
void SV_ListMatches_f( list_t *list ) {