Changeset 7585


Ignore:
Timestamp:
Jan 2, 2009, 9:45:55 PM (12 years ago)
Author:
jhujhiti
Message:

(trunk libT) use IN_MULTICAST macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r7574 r7585  
    4949#include "utils.h"
    5050
     51#ifndef IN_MULTICAST
     52#define IN_MULTICAST( a ) ( ( ( a ) & 0xf0000000 ) == 0xe0000000 )
     53#endif
     54
    5155const tr_address tr_in6addr_any = { TR_AF_INET6, { IN6ADDR_ANY_INIT } };
    5256const tr_address tr_inaddr_any = { TR_AF_INET,
     
    412416
    413417    /* don't try to connect to multicast addresses */
    414     if( addr->type == TR_AF_INET && ( ntohl( addr->addr.addr4.s_addr ) & 0xe0000000 ) )
     418    if( addr->type == TR_AF_INET && IN_MULTICAST( htonl( addr->addr.addr4.s_addr ) ) )
    415419        return -EINVAL;
    416420    if( addr->type == TR_AF_INET6 && ( addr->addr.addr6.s6_addr[0] & 0xff ) )
Note: See TracChangeset for help on using the changeset viewer.