Changeset 1122:d4371b7aa0ff in freeDiameter for libfdcore
- Timestamp:
- May 14, 2013, 7:01:31 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libfdcore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/endpoints.c
r1119 r1122 94 94 return 0; 95 95 } 96 96 97 97 /* remove the ACCEPTALL flag */ 98 98 flags &= ~EP_ACCEPTALL; … … 135 135 break; 136 136 } 137 if (*ep_port < *port) 138 continue; 137 if (*ep_port < *port) { 138 cmp = -1; 139 continue; 140 } 139 141 if (*ep_port > *port) 140 142 cmp = 1; … … 217 219 while ((li_out != list) && (li_ex != exclude_list)) { 218 220 int cmp; 219 221 in_port_t * port_out, *port_ex; 222 220 223 out = (struct fd_endpoint *)li_out; 221 224 ex = (struct fd_endpoint *)li_ex; … … 235 238 case AF_INET: 236 239 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; 237 242 break; 238 243 case AF_INET6: 239 244 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; 240 247 break; 241 248 default: … … 250 257 li_ex = li_ex->next; 251 258 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 } 252 270 } 253 271 … … 298 316 } 299 317 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); 301 319 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{%s%s%s%s%s}", 302 320 (ep->flags & EP_FL_CONF) ? "C" : "-", -
libfdcore/p_ce.c
r1119 r1122 110 110 for (li = fd_g_config->cnf_endpoints.next; li != &fd_g_config->cnf_endpoints; li = li->next) { 111 111 struct fd_endpoint * ep = (struct fd_endpoint *)li; 112 113 112 CHECK_FCT( fd_msg_avp_new ( dictobj, 0, &avp ) ); 114 113 CHECK_FCT( fd_msg_avp_value_encode ( &ep->ss, avp ) ); -
libfdcore/server.c
r1113 r1122 342 342 int empty_conf_ep = FD_IS_LIST_EMPTY(&fd_g_config->cnf_endpoints); 343 343 344 struct fd_list filter_list = FD_LIST_INITIALIZER(filter_list); 345 344 346 /* SCTP */ 345 347 if (!fd_g_config->cnf_flags.no_sctp) { … … 447 449 } 448 450 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 449 478 { 450 479 char * buf = NULL; -
libfdcore/tcp.c
r1085 r1122 138 138 pthread_cleanup_push(fd_cleanup_socket, &s); 139 139 140 LOG_D( "Attempting TCP connection to %s...", fd_sa_dump _node(&buf, &len, NULL, sa, NI_NUMERICHOST | NI_NUMERICSERV)?:"<error>" );140 LOG_D( "Attempting TCP connection to %s...", fd_sa_dump(&buf, &len, NULL, sa, NI_NUMERICHOST | NI_NUMERICSERV)?:"<error>" ); 141 141 free(buf); 142 142
Note: See TracChangeset
for help on using the changeset viewer.