changeset 933:04f590da5821

Add cmake option DISABLE_PEER_EXPIRY to disable dynamic peer expiration mechanism
author Sebastien Decugis <sdecugis@freediameter.net>
date Wed, 06 Mar 2013 16:39:07 +0100
parents 76fa782bb597
children 977a5375543c d95cd3ca9e8d
files include/freeDiameter/CMakeLists.txt include/freeDiameter/freeDiameter-host.h.in libfdcore/peers.c
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/include/freeDiameter/CMakeLists.txt	Sun Mar 03 09:16:42 2013 +0100
+++ b/include/freeDiameter/CMakeLists.txt	Wed Mar 06 16:39:07 2013 +0100
@@ -24,7 +24,12 @@
 	OPTION (DIAMID_IDNA_REJECT "Reject internationalized Diameter Identities, do not attempt to convert it (stringprep) ?" OFF)
 ENDIF (NOT DIAMID_IDNA_IGNORE)
 
-MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO DIAMID_IDNA_IGNORE DIAMID_IDNA_REJECT)
+# Disable expiration of connections with dynamically connected peers as per RFC 3539 ? (default is enabled)
+# Note: if someone needs, we could also make the delay configurable here...
+OPTION(DISABLE_PEER_EXPIRY "Disable RFC3539 Peers Connections Expiration after inactivity?" OFF)
+
+
+MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO DIAMID_IDNA_IGNORE DIAMID_IDNA_REJECT DISABLE_PEER_EXPIRY)
 
 ########################
 ### System checks part
--- a/include/freeDiameter/freeDiameter-host.h.in	Sun Mar 03 09:16:42 2013 +0100
+++ b/include/freeDiameter/freeDiameter-host.h.in	Wed Mar 06 16:39:07 2013 +0100
@@ -58,6 +58,7 @@
 #cmakedefine SKIP_DLCLOSE
 #cmakedefine DIAMID_IDNA_IGNORE
 #cmakedefine DIAMID_IDNA_REJECT
+#cmakedefine DISABLE_PEER_EXPIRY
 #cmakedefine GNUTLS_VERSION_210
 #cmakedefine GNUTLS_VERSION_300
 #cmakedefine GNUTLS_VERSION_310
--- a/libfdcore/peers.c	Sun Mar 03 09:16:42 2013 +0100
+++ b/libfdcore/peers.c	Wed Mar 06 16:39:07 2013 +0100
@@ -514,12 +514,14 @@
 		peer->p_flags.pf_responder = 1;
 		peer->p_flags.pf_delete = 1;
 		
+#ifndef DISABLE_PEER_EXPIRY
 		/* Set this peer to expire on inactivity */
 		peer->p_hdr.info.config.pic_flags.exp 	= PI_EXP_INACTIVE;
 		peer->p_hdr.info.config.pic_lft		= 3600;	/* 1 hour without any message 
 		-- RFC3539 states that this must not be inferior to BRINGDOWN_INTERVAL = 5 minutes */
+		
 		CHECK_FCT_DO( ret = fd_p_expi_update( peer ), goto out );
-
+#endif /* DISABLE_PEER_EXPIRY */
 		
 		/* Insert the new peer in the list (the PSM will take care of setting the expiry after validation) */
 		fd_list_insert_after( li_inf, &peer->p_hdr.chain );
"Welcome to our mercurial repository"