Ignore:
Timestamp:
Dec 15, 2008, 12:17:08 AM (12 years ago)
Author:
charles
Message:

(trunk libT) add ipv6 support by jhujhiti. I think this is the largest user-contributed patch we've ever used... thanks jhujhiti :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r7232 r7397  
    451451
    452452int
    453 tr_fdSocketCreate( int type )
     453tr_fdSocketCreate( int domain, int type )
    454454{
    455455    int s = -1;
     
    458458
    459459    if( gFd->socketCount < getSocketMax( gFd ) )
    460         if( ( s = socket( AF_INET, type, 0 ) ) < 0 )
     460        if( ( s = socket( domain, type, 0 ) ) < 0 )
     461        {
    461462            tr_err( _( "Couldn't create socket: %s" ),
    462463                   tr_strerror( sockerrno ) );
     464            s = -sockerrno;
     465        }
    463466
    464467    if( s > -1 )
     
    486489    if( gFd->socketCount < getSocketMax( gFd ) )
    487490    {
    488         len = sizeof( struct sockaddr );
     491        len = sizeof( struct sockaddr_storage );
    489492        s = accept( b, (struct sockaddr *) &sock, &len );
    490493    }
     
    504507            struct sockaddr_in6 * sock6 = (struct sockaddr_in6 *)&sock;
    505508            addr->type = TR_AF_INET6;
    506             memcpy( &addr->addr, &sock6->sin6_addr,
    507                     sizeof( struct sockaddr_in6 ) );
     509            addr->addr.addr6 = sock6->sin6_addr;
    508510            *port = sock6->sin6_port;
    509511        }
Note: See TracChangeset for help on using the changeset viewer.