]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
Fix endianess issue with blessed ips. Document -A feature.
authorerdgeist <>
Thu, 29 Mar 2007 15:04:06 +0000 (15:04 +0000)
committererdgeist <>
Thu, 29 Mar 2007 15:04:06 +0000 (15:04 +0000)
opentracker.c

index d45fcf871645712a0e017c50e6911312368675ef..2d2058b7f3177b0e7b7f5bb8d42e3ceeb20edc66 100644 (file)
@@ -494,6 +494,7 @@ static void help( char *name ) {
                    "\t-p serverport\tspecify tcp port to bind to (default: 6969, you may specify more than one)\n"
                    "\t-P serverport\tspecify udp port to bind to (default: 6969, you may specify more than one)\n"
                    "\t-d serverdir\tspecify directory containing white- or black listed torrent info_hashes (default: \".\")\n"
+                   "\t-A adminip\tbless an ip address as admin address (e.g. to allow snycs from this address)\n"
                    "\nExample:   ./opentracker -i 127.0.0.1 -p 6969 -P 6969 -i 10.1.1.23 -p 2710 -p 80\n"
 );
 }
@@ -563,7 +564,7 @@ static void handle_accept( const int64 serversocket ) {
     byte_zero( h, sizeof( struct http_data ) );
     memmove( h->ip, ip, sizeof( ip ) );
 
-    if( ntohl(*(ot_dword*)&h->ip) == *(ot_dword*)g_adminip )
+    if( !byte_diff( &h->ip, 4, g_adminip ) )
       h->blessed = 1;
 
     io_setcookie( i, h );