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

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

File:
1 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 )
Note: See TracChangeset for help on using the changeset viewer.