comparison libfdcore/server.c @ 1136:140450615773

Revert changeset 1122 (ADDRESS_AVP_INCLUDE_PORT) as this will create too much interop issues. The Host-IP-Address AVP is not normally used to discover peer address, but only for validation of the addresses where a packet is received from -- which is quite useless with a connected transport connection, but anyway...
author Sebastien Decugis <sdecugis@freediameter.net>
date Thu, 16 May 2013 14:56:31 +0800
parents d4371b7aa0ff
children 22de21feec64
comparison
equal deleted inserted replaced
1135:90e0382e6579 1136:140450615773
339 { 339 {
340 struct server * s; 340 struct server * s;
341 341
342 int empty_conf_ep = FD_IS_LIST_EMPTY(&fd_g_config->cnf_endpoints); 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
346 /* SCTP */ 344 /* SCTP */
347 if (!fd_g_config->cnf_flags.no_sctp) { 345 if (!fd_g_config->cnf_flags.no_sctp) {
348 #ifdef DISABLE_SCTP 346 #ifdef DISABLE_SCTP
349 ASSERT(0); 347 ASSERT(0);
350 #else /* DISABLE_SCTP */ 348 #else /* DISABLE_SCTP */
446 "This information is required to generate the CER/CEA messages."); 444 "This information is required to generate the CER/CEA messages.");
447 return EINVAL; 445 return EINVAL;
448 } 446 }
449 } 447 }
450 448
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
478 { 449 {
479 char * buf = NULL; 450 char * buf = NULL;
480 size_t len = 0, offset = 0; 451 size_t len = 0, offset = 0;
481 CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset , "Local server address(es): "), ); 452 CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset , "Local server address(es): "), );
482 CHECK_MALLOC_DO( fd_ep_dump( &buf, &len, &offset, 0, 0, &fd_g_config->cnf_endpoints ), ); 453 CHECK_MALLOC_DO( fd_ep_dump( &buf, &len, &offset, 0, 0, &fd_g_config->cnf_endpoints ), );
"Welcome to our mercurial repository"