Navigation


Changeset 1122:d4371b7aa0ff in freeDiameter for libfdcore/endpoints.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/endpoints.c

    r1119 r1122  
    9494                        return 0;
    9595        }
    96 
     96       
    9797        /* remove the ACCEPTALL flag */
    9898        flags &= ~EP_ACCEPTALL;
     
    135135                        break;
    136136                }
    137                 if (*ep_port < *port)
    138                         continue;
     137                if (*ep_port < *port) {
     138                        cmp = -1;
     139                        continue;
     140                }
    139141                if (*ep_port > *port)
    140142                        cmp = 1;
     
    217219        while ((li_out != list) && (li_ex != exclude_list)) {
    218220                int cmp;
    219 
     221                in_port_t * port_out, *port_ex;
     222               
    220223                out = (struct fd_endpoint *)li_out;
    221224                ex = (struct fd_endpoint *)li_ex;
     
    235238                        case AF_INET:
    236239                                cmp = memcmp(&out->sin.sin_addr, &ex->sin.sin_addr, sizeof(struct in_addr));
     240                                port_out = &out->sin.sin_port;
     241                                port_ex = &ex->sin.sin_port;
    237242                                break;
    238243                        case AF_INET6:
    239244                                cmp = memcmp(&out->sin6.sin6_addr, &ex->sin6.sin6_addr, sizeof(struct in6_addr));
     245                                port_out = &out->sin6.sin6_port;
     246                                port_ex = &ex->sin6.sin6_port;
    240247                                break;
    241248                        default:
     
    250257                        li_ex = li_ex->next;
    251258                        continue;
     259                }
     260               
     261                if (port_out && (*port_out != 0) && (*port_ex != 0)) {
     262                        if (*port_out < *port_ex) {
     263                                li_out = li_out->next;
     264                                continue;
     265                        }
     266                        if (*port_out > *port_ex) {
     267                                li_ex = li_ex->next;
     268                                continue;
     269                        }
    252270                }
    253271       
     
    298316        }
    299317       
    300         CHECK_MALLOC_DO( fd_sa_dump_node_serv( FD_DUMP_STD_PARAMS, &ep->sa, NI_NUMERICHOST | NI_NUMERICSERV ), return NULL);
     318        CHECK_MALLOC_DO( fd_sa_dump( FD_DUMP_STD_PARAMS, &ep->sa, NI_NUMERICHOST | NI_NUMERICSERV ), return NULL);
    301319        CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{%s%s%s%s%s}",
    302320                                (ep->flags & EP_FL_CONF)        ? "C" : "-",
Note: See TracChangeset for help on using the changeset viewer.