Changeset 1103:d8591b1c56cd in freeDiameter for libfdcore/peers.c
- Timestamp:
- May 10, 2013, 7:48:57 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/peers.c
r1093 r1103 491 491 if (!avp_oh_model) { 492 492 avp_code_t code = AC_ORIGIN_HOST; 493 int ret; 494 CHECK_FCT_DO( ret = fd_dict_search ( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_CODE, &code, &avp_oh_model, ENOENT), 495 { CHECK_POSIX( pthread_mutex_unlock(&cache_avp_lock) ); return ret; } ); 493 CHECK_FCT_DO( fd_dict_search ( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_CODE, &code, &avp_oh_model, ENOENT), 494 { LOG_E("Cannot find Origin-Host AVP definition in the dictionary!"); (void) pthread_mutex_unlock(&cache_avp_lock); return __ret__; } ); 496 495 } 497 496 CHECK_POSIX( pthread_mutex_unlock(&cache_avp_lock) ); … … 504 503 /* First, check if the Origin-Host value is valid */ 505 504 if (!fd_os_is_valid_DiameterIdentity(avp_hdr->avp_value->os.data, avp_hdr->avp_value->os.len)) { 506 TRACE_DEBUG(INFO, "Received new CER with invalid Origin-Host");507 505 CHECK_FCT( fd_msg_new_answer_from_req ( fd_g_config->cnf_dict, cer, MSGFL_ANSW_ERROR ) ); 508 506 CHECK_FCT( fd_msg_rescode_set(*cer, "DIAMETER_INVALID_AVP_VALUE", 509 507 "Your Origin-Host contains invalid characters.", avp_oh, 1 ) ); 508 509 fd_hook_call(HOOK_PEER_CONNECT_FAILED, *cer, NULL, "Received CER with invalid Origin-Host AVP", NULL); 510 510 511 CHECK_FCT( fd_out_send(cer, *cnx, NULL, FD_CNX_ORDERED) ); 511 512 return EINVAL; … … 545 546 peer->p_flags.pf_responder = 1; 546 547 peer->p_flags.pf_delete = 1; 548 549 LOG_D("Created new peer object for incoming CER: %s", peer->p_hdr.info.pi_diamid); 547 550 548 551 #ifndef DISABLE_PEER_EXPIRY … … 591 594 *cer = NULL; 592 595 *cnx = NULL; 596 } else { 597 char buf[1024]; 598 snprintf(buf, sizeof(buf), "An error occurred while processing new incoming CER: %s", strerror(ret)); 599 fd_hook_call(HOOK_PEER_CONNECT_FAILED, *cer, NULL, buf, NULL); 593 600 } 594 601
Note: See TracChangeset
for help on using the changeset viewer.