Navigation


Changeset 1122:d4371b7aa0ff in freeDiameter for libfdcore/server.c


Ignore:
Timestamp:
May 14, 2013, 7:01:31 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

New CMake option: ADDRESS_AVP_INCLUDE_PORT. Turn off for standard Host-IP-Address AVPs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/server.c

    r1113 r1122  
    342342        int empty_conf_ep = FD_IS_LIST_EMPTY(&fd_g_config->cnf_endpoints);
    343343       
     344        struct fd_list filter_list = FD_LIST_INITIALIZER(filter_list);
     345       
    344346        /* SCTP */
    345347        if (!fd_g_config->cnf_flags.no_sctp) {
     
    447449        }
    448450       
     451        /* we will filter this list and create endpoints with port information */
     452        #ifdef ADDRESS_AVP_INCLUDE_PORT
     453        fd_list_move_end(&filter_list, &fd_g_config->cnf_endpoints);
     454        while (!FD_IS_LIST_EMPTY(&filter_list)) {
     455                struct fd_endpoint * ep = (struct fd_endpoint *)filter_list.next;
     456                in_port_t * port = NULL;
     457                fd_list_unlink(&ep->chain);
     458               
     459                switch( ep->sa.sa_family ) {
     460                case AF_INET: port = &ep->sin.sin_port; break;
     461                case AF_INET6: port = &ep->sin6.sin6_port; break;
     462                }
     463               
     464                if (port) {
     465                        if (fd_g_config->cnf_port) {
     466                                *port = htons(fd_g_config->cnf_port);
     467                                CHECK_FCT(fd_ep_add_merge( &fd_g_config->cnf_endpoints, &ep->sa, sSAlen(&ep->sa), ep->flags ));
     468                        }
     469                        if (fd_g_config->cnf_port_tls) {
     470                                *port = htons(fd_g_config->cnf_port_tls);
     471                                CHECK_FCT(fd_ep_add_merge( &fd_g_config->cnf_endpoints, &ep->sa, sSAlen(&ep->sa), ep->flags ));
     472                        }
     473                }
     474                free(ep);
     475        }
     476        #endif /* ADDRESS_AVP_INCLUDE_PORT */
     477       
    449478        {
    450479                char * buf = NULL;
Note: See TracChangeset for help on using the changeset viewer.