# HG changeset patch # User Sebastien Decugis # Date 1362584347 -3600 # Node ID 04f590da582199b3b3d8118d480e3e49180b5b59 # Parent 76fa782bb597b90c3f707323c39c2875f4c990bf Add cmake option DISABLE_PEER_EXPIRY to disable dynamic peer expiration mechanism diff -r 76fa782bb597 -r 04f590da5821 include/freeDiameter/CMakeLists.txt --- 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 diff -r 76fa782bb597 -r 04f590da5821 include/freeDiameter/freeDiameter-host.h.in --- 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 diff -r 76fa782bb597 -r 04f590da5821 libfdcore/peers.c --- 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 );