(trunk libT) remove tr_suspectAddress() since all seems well

This commit is contained in:
Erick Turnquist 2009-03-27 01:14:25 +00:00
parent cc1a4ec1e9
commit dd7eb76718
5 changed files with 0 additions and 42 deletions

View File

@ -127,40 +127,6 @@ tr_netInit( void )
}
}
void
tr_suspectAddress( const tr_address * a UNUSED, const char * source UNUSED )
{
/* this is overkill for a production environment,
* but useful in the nightly builds, so only compile it into the nightlies */
#ifdef TR_UNSTABLE
/* be really aggressive in what we report */
if( a->type == TR_AF_INET && !( ntohl( a->addr.addr4.s_addr ) & 0xff000000 ) )
tr_err( "Funny looking address %s from %s", tr_ntop_non_ts( a ), source );
/* /16s taken from ipv6 rib on 21 dec, 2008 */
/* this is really, really ugly. expedience over quality */
if( a->type == TR_AF_INET6 )
{
uint16_t slash16;
uint16_t valid[] = { 0x339, 0x2002, 0x2003, 0x2400, 0x2401, 0x2402,
0x2403, 0x2404, 0x2405, 0x2406, 0x2407, 0x2600, 0x2607, 0x2610,
0x2620, 0x2800, 0x2801, 0x2a00, 0x2a01, 0x0a02, 0x2001, 0x0000 };
uint16_t *p;
tr_bool good = FALSE;
p = valid;
memcpy( &slash16, &a->addr, 2 );
slash16 = ntohs( slash16 );
while( *p )
{
if( slash16 == *p )
good = TRUE;
p++;
}
if( !good && !IN6_IS_ADDR_V4MAPPED( &a->addr.addr6 ) )
tr_err( "Funny looking address %s from %s", tr_ntop_non_ts( a ), source );
}
#endif
}
const char *
tr_ntop( const tr_address * src, char * dst, int size )
{

View File

@ -90,8 +90,6 @@ void tr_normalizeV4Mapped( tr_address * const addr );
tr_bool tr_isValidPeerAddress( const tr_address * addr, tr_port port );
void tr_suspectAddress( const tr_address * a, const char * source );
static TR_INLINE tr_bool tr_isAddress( const tr_address * a ) { return ( a != NULL ) && ( a->type==TR_AF_INET || a->type==TR_AF_INET6 ); }
tr_bool tr_net_hasIPv6( tr_port );

View File

@ -1457,7 +1457,6 @@ tr_peerMgrArrayToPex( const void * array,
for( i = 0 ; i < n ; i++ ) {
memcpy( &pex[i].addr, walk, sizeof( tr_address ) );
tr_suspectAddress( &pex[i].addr, "tracker" );
memcpy( &pex[i].port, walk + sizeof( tr_address ), 2 );
pex[i].flags = 0x00;
walk += sizeof( tr_address ) + 2;

View File

@ -1987,7 +1987,6 @@ sendPex( tr_peermsgs * msgs )
tmp = walk = tr_new( uint8_t, diffs.addedCount * 6 );
for( i = 0; i < diffs.addedCount; ++i )
{
tr_suspectAddress( &diffs.added[i].addr, "pex" );
memcpy( walk, &diffs.added[i].addr.addr, 4 ); walk += 4;
memcpy( walk, &diffs.added[i].port, 2 ); walk += 2;
}
@ -2018,7 +2017,6 @@ sendPex( tr_peermsgs * msgs )
tmp = walk = tr_new( uint8_t, diffs6.addedCount * 18 );
for( i = 0; i < diffs6.addedCount; ++i )
{
tr_suspectAddress( &diffs6.added[i].addr, "pex6" );
memcpy( walk, &diffs6.added[i].addr.addr.addr6.s6_addr, 16 );
walk += 16;
memcpy( walk, &diffs6.added[i].port, 2 );

View File

@ -259,7 +259,6 @@ publishNewPeersCompact( tr_tracker * t,
{
memcpy( &addr.addr.addr4, compactWalk, 4 );
memcpy( &port, compactWalk + 4, 2 );
tr_suspectAddress( &addr, "compact" );
memcpy( walk, &addr, sizeof( addr ) );
memcpy( walk + sizeof( addr ), &port, 2 );
@ -292,7 +291,6 @@ publishNewPeersCompact6( tr_tracker * t,
memcpy( &addr.addr.addr6, compactWalk, 16 );
memcpy( &port, compactWalk + 16, 2 );
compactWalk += 18;
tr_suspectAddress( &addr, "compact6" );
memcpy( walk, &addr, sizeof( addr ) );
memcpy( walk + sizeof( addr ), &port, 2 );
@ -368,7 +366,6 @@ parseOldPeers( tr_benc * bePeers,
continue;
memcpy( walk, &addr, sizeof( tr_address ) );
tr_suspectAddress( &addr, "old tracker" );
port = htons( itmp );
memcpy( walk + sizeof( tr_address ), &port, 2 );
walk += sizeof( tr_address ) + 2;