Changeset 8091


Ignore:
Timestamp:
Mar 27, 2009, 1:14:25 AM (13 years ago)
Author:
jhujhiti
Message:

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

Location:
trunk/libtransmission
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r7851 r8091  
    128128}
    129129
    130 void
    131 tr_suspectAddress( const tr_address * a UNUSED, const char * source UNUSED )
    132 {
    133 /* this is overkill for a production environment,
    134  * but useful in the nightly builds, so only compile it into the nightlies */
    135 #ifdef TR_UNSTABLE
    136     /* be really aggressive in what we report */
    137     if( a->type == TR_AF_INET && !( ntohl( a->addr.addr4.s_addr ) & 0xff000000 ) )
    138         tr_err(  "Funny looking address %s from %s", tr_ntop_non_ts( a ), source );
    139     /* /16s taken from ipv6 rib on 21 dec, 2008 */
    140     /* this is really, really ugly. expedience over quality */
    141     if( a->type == TR_AF_INET6 )
    142     {
    143         uint16_t slash16;
    144         uint16_t valid[] = { 0x339, 0x2002, 0x2003, 0x2400, 0x2401, 0x2402,
    145             0x2403, 0x2404, 0x2405, 0x2406, 0x2407, 0x2600, 0x2607, 0x2610,
    146             0x2620, 0x2800, 0x2801, 0x2a00, 0x2a01, 0x0a02, 0x2001, 0x0000 };
    147         uint16_t *p;
    148         tr_bool good = FALSE;
    149         p = valid;
    150         memcpy( &slash16, &a->addr, 2 );
    151         slash16 = ntohs( slash16 );
    152         while( *p )
    153         {
    154             if( slash16 == *p )
    155                 good = TRUE;
    156             p++;
    157         }
    158         if( !good && !IN6_IS_ADDR_V4MAPPED( &a->addr.addr6 ) )
    159             tr_err(  "Funny looking address %s from %s", tr_ntop_non_ts( a ), source );
    160     }
    161 #endif
    162 }
    163 
    164130const char *
    165131tr_ntop( const tr_address * src, char * dst, int size )
  • trunk/libtransmission/net.h

    r7839 r8091  
    9191tr_bool tr_isValidPeerAddress( const tr_address * addr, tr_port port );
    9292
    93 void tr_suspectAddress( const tr_address * a, const char * source );
    94 
    9593static TR_INLINE tr_bool tr_isAddress( const tr_address * a ) { return ( a != NULL ) && ( a->type==TR_AF_INET || a->type==TR_AF_INET6 ); }
    9694
  • trunk/libtransmission/peer-mgr.c

    r7977 r8091  
    14581458    for( i = 0 ; i < n ; i++ ) {
    14591459        memcpy( &pex[i].addr, walk, sizeof( tr_address ) );
    1460         tr_suspectAddress( &pex[i].addr, "tracker"  );
    14611460        memcpy( &pex[i].port, walk + sizeof( tr_address ), 2 );
    14621461        pex[i].flags = 0x00;
  • trunk/libtransmission/peer-msgs.c

    r7921 r8091  
    19881988            for( i = 0; i < diffs.addedCount; ++i )
    19891989            {
    1990                 tr_suspectAddress( &diffs.added[i].addr, "pex" );
    19911990                memcpy( walk, &diffs.added[i].addr.addr, 4 ); walk += 4;
    19921991                memcpy( walk, &diffs.added[i].port, 2 ); walk += 2;
     
    20192018            for( i = 0; i < diffs6.addedCount; ++i )
    20202019            {
    2021                 tr_suspectAddress( &diffs6.added[i].addr, "pex6" );
    20222020                memcpy( walk, &diffs6.added[i].addr.addr.addr6.s6_addr, 16 );
    20232021                walk += 16;
  • trunk/libtransmission/tracker.c

    r7834 r8091  
    260260        memcpy( &addr.addr.addr4, compactWalk, 4 );
    261261        memcpy( &port, compactWalk + 4, 2 );
    262         tr_suspectAddress( &addr, "compact" );
    263262       
    264263        memcpy( walk, &addr, sizeof( addr ) );
     
    293292        memcpy( &port, compactWalk + 16, 2 );
    294293        compactWalk += 18;
    295         tr_suspectAddress( &addr, "compact6" );
    296294       
    297295        memcpy( walk, &addr, sizeof( addr ) );
     
    369367
    370368        memcpy( walk, &addr, sizeof( tr_address ) );
    371         tr_suspectAddress( &addr, "old tracker" );
    372369        port = htons( itmp );
    373370        memcpy( walk + sizeof( tr_address ), &port, 2 );
Note: See TracChangeset for help on using the changeset viewer.