Navigation


Changeset 246:6418a188c1b5 in freeDiameter


Ignore:
Timestamp:
Apr 2, 2010, 3:27:46 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

getnameinfo is also more sensitive on freeBSD

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • freeDiameter/cnxctx.c

    r245 r246  
    129129
    130130        /* Create the socket */
    131         CHECK_FCT_DO( fd_tcp_create_bind_server( &cnx->cc_socket, sa, sSSlen(sa) ), goto error );
     131        CHECK_FCT_DO( fd_tcp_create_bind_server( &cnx->cc_socket, sa, sSAlen(sa) ), goto error );
    132132
    133133        /* Generate the name for the connection object */
  • freeDiameter/p_cnx.c

    r219 r246  
    228228                switch (nc->proto) {
    229229                        case IPPROTO_TCP:
    230                                 cnx = fd_cnx_cli_connect_tcp((sSA *)&nc->ss, sSSlen(&nc->ss));
     230                                cnx = fd_cnx_cli_connect_tcp((sSA *)&nc->ss, sSAlen(&nc->ss));
    231231                                break;
    232232#ifndef DISABLE_SCTP                   
  • freeDiameter/sctp.c

    r245 r246  
    714714                        s.sin6.sin6_port = htons(port);
    715715               
    716                 CHECK_SYS( bind(*sock, &s.sa, sSSlen(&s)) );
     716                CHECK_SYS( bind(*sock, &s.sa, sSAlen(&s)) );
    717717               
    718718        } else {
  • freeDiameter/tests/testcnx.c

    r208 r246  
    486486                        {
    487487                                struct fd_endpoint * ep = (struct fd_endpoint *)(eps.next);
    488                                 cnx = fd_cnx_cli_connect_tcp( &ep->sa, sSSlen(&ep->ss) );
     488                                cnx = fd_cnx_cli_connect_tcp( &ep->sa, sSAlen(&ep->ss) );
    489489                                CHECK( 1, (cnx ? 1 : 0) ^ cf->expect_failure );
    490490                        }
  • include/freeDiameter/libfreeDiameter.h

    r245 r246  
    272272#define sSA6    struct sockaddr_in6
    273273
     274/* The sockaddr length of a sSS structure */
     275#define sSAlen( _sa_ )  \
     276        ( (socklen_t) ( (((sSA *)_sa_)->sa_family == AF_INET) ? (sizeof(sSA4)) :                \
     277                                ((((sSA *)_sa_)->sa_family == AF_INET6) ? (sizeof(sSA6)) :      \
     278                                        0 ) ) )
     279
    274280/* Dump one sockaddr Node information */
    275281#define sSA_DUMP_NODE( sa, flag ) {                             \
     
    278284        if (__sa) {                                             \
    279285          int __rc = getnameinfo(__sa,                          \
    280                         sizeof(sSS),                            \
     286                        sSAlen(__sa),                           \
    281287                        __addrbuf,                              \
    282288                        sizeof(__addrbuf),                      \
     
    299305        if (__sa) {                                                     \
    300306          int __rc = getnameinfo(__sa,                                  \
    301                         sizeof(sSS),                                    \
     307                        sSAlen(__sa),                                   \
    302308                        __addrbuf,                                      \
    303309                        sizeof(__addrbuf),                              \
     
    452458                        "Unknown"))
    453459#endif /* DISABLE_SCTP */
    454 
    455 /* The sockaddr length of a sSS structure */
    456 #define sSSlen( _ss_ )  \
    457         ( (socklen_t) ( (((sSS *)_ss_)->ss_family == AF_INET) ? (sizeof(sSA4)) :                \
    458                                 ((((sSS *)_ss_)->ss_family == AF_INET6) ? (sizeof(sSA6)) :      \
    459                                         0 ) ) )
    460460
    461461/* Define the value of IP loopback address */
Note: See TracChangeset for help on using the changeset viewer.