Navigation


Changeset 378:41e3c2a3721c in freeDiameter for freeDiameter/p_ce.c


Ignore:
Timestamp:
Jul 5, 2010, 4:21:22 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Replaced old mechanism to discover local addresses by a call to getifaddrs, lot cleaner!
Should close #4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freeDiameter/p_ce.c

    r332 r378  
    6363       
    6464        /* Read the endpoints, maybe used to reconnect to the peer later */
    65         CHECK_FCT( fd_cnx_getendpoints(peer->p_cnxctx, NULL, &peer->p_hdr.info.pi_endpoints) );
     65        CHECK_FCT( fd_cnx_getremoteeps(peer->p_cnxctx, &peer->p_hdr.info.pi_endpoints) );
    6666       
    6767        /* Read the protocol */
     
    106106        struct avp * avp = NULL;
    107107        union avp_value val;
    108         struct fd_list *li, local_ep = FD_LIST_INITIALIZER(local_ep);
     108        struct fd_list *li;
    109109       
    110110        /* Add the Origin-* AVPs */
     
    114114        CHECK_FCT(  fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Host-IP-Address", &dictobj, ENOENT )  );
    115115               
    116         /* Get the list of endpoints */
    117         CHECK_FCT(  fd_cnx_getendpoints(cnx, &local_ep, NULL) );
    118        
    119116        /* Add the AVP(s) -- not sure what is the purpose... We could probably only add the primary one ? */
    120         for (li = local_ep.next; li != &local_ep; li = li->next) {
     117        for (li = fd_g_config->cnf_endpoints.next; li != &fd_g_config->cnf_endpoints; li = li->next) {
    121118                struct fd_endpoint * ep = (struct fd_endpoint *)li;
    122119               
     
    125122                CHECK_FCT( fd_msg_avp_add( msg, MSG_BRW_LAST_CHILD, avp ) );
    126123        }
    127        
    128124       
    129125        /* Vendor-Id, Product-Name, and Firmware-Revision AVPs */
Note: See TracChangeset for help on using the changeset viewer.