diff libfdcore/p_psm.c @ 1326:afe0ecdb0692

Add config option if Route-Record AVPs should be added in Answers. Some software does not handle them correctly.
author Thomas Klausner <tk@giga.or.at>
date Mon, 27 Nov 2017 15:18:57 +0100
parents 8288982c63b7
children e7726fae1e7f
line wrap: on
line diff
--- a/libfdcore/p_psm.c	Mon Nov 27 15:16:30 2017 +0100
+++ b/libfdcore/p_psm.c	Mon Nov 27 15:18:57 2017 +0100
@@ -552,7 +552,9 @@
 					CHECK_FCT_DO( fd_p_expi_update(peer), goto psm_end );
 
 					/* Set the message source and add the Route-Record */
-					CHECK_FCT_DO( fd_msg_source_setrr( msg, peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen, fd_g_config->cnf_dict ), goto psm_end);
+					if (fd_g_config->cnf_rr_in_answers || (hdr->msg_flags & CMD_FLAG_REQUEST)) {
+						CHECK_FCT_DO( fd_msg_source_setrr( msg, peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen, fd_g_config->cnf_dict ), goto psm_end);
+					}
 
 					if ((hdr->msg_flags & CMD_FLAG_REQUEST)) {
 						/* Mark the incoming request so that we know we have pending answers for this peer */
"Welcome to our mercurial repository"