From 4e9523c48905bdc6b384a403012c6e320e9d8f47 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Thu, 29 Mar 2007 15:04:06 +0000 Subject: [PATCH] Fix endianess issue with blessed ips. Document -A feature. --- opentracker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opentracker.c b/opentracker.c index d45fcf8..2d2058b 100644 --- a/opentracker.c +++ b/opentracker.c @@ -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 );