changeset 961:d95cd3ca9e8d

merge latest 1.1 branch (one commit post 1.1.6)
author Thomas Klausner <tk@giga.or.at>
date Wed, 06 Mar 2013 20:09:54 +0100
parents f39fa6cd86e0 (current diff) 04f590da5821 (diff)
children 398e9b1ebf87
files .hgtags extensions/acl_wl/aw_conf.y include/freeDiameter/libfdproto.h libfdcore/cnxctx.c libfdcore/core.c libfdcore/fdd.l libfdcore/fdd.y libfdcore/peers.c libfdcore/sctp.c libfdproto/dictionary.c libfdproto/log.c libfdproto/messages.c
diffstat 36 files changed, 252 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Mar 05 22:52:35 2013 +0100
+++ b/.hgtags	Wed Mar 06 20:09:54 2013 +0100
@@ -30,3 +30,4 @@
 226f5957186ae4369467b070aeb61b1c631c9a5c 1.1.5-rc2
 ae96ae28f3ddc48b9e2676e9538008eab2b9d60a 1.1.5
 8500947421cb412b5f4f2dfffdf1a35b6fb369e0 FORK
+155d45d0653025f45b58ab96b6ba0d5e6fb7fcf8 1.1.6
--- a/CMakeLists.txt	Tue Mar 05 22:52:35 2013 +0100
+++ b/CMakeLists.txt	Wed Mar 06 20:09:54 2013 +0100
@@ -11,10 +11,10 @@
 # Version of the source code
 SET(FD_PROJECT_VERSION_MAJOR 1)
 SET(FD_PROJECT_VERSION_MINOR 1)
-SET(FD_PROJECT_VERSION_REV 5)
+SET(FD_PROJECT_VERSION_REV 6)
 
 # Version of the API with the library
-SET(FD_PROJECT_VERSION_API 4)
+SET(FD_PROJECT_VERSION_API 5)
 
 # The test framework, using CTest and CDash.
 INCLUDE(CTest)
--- a/contrib/debian/changelog	Tue Mar 05 22:52:35 2013 +0100
+++ b/contrib/debian/changelog	Wed Mar 06 20:09:54 2013 +0100
@@ -1,3 +1,18 @@
+freediameter (1.1.6) UNRELEASED; urgency=low
+
+  * Fix major issue in 1.1.5 preventing to send answers to a received message.
+  * New command-line option: --enable_msg_log=( DROPPED | RECEIVED | SENT | NODELIVER | TIMING )
+  * Improved parsing error handling and Failed-AVP generation.
+  * Added support for some timings measurements in freeDiameter (in the logs)
+  * Fix port handling when using non-default port.
+  * Some cleanups in several dictionary files.
+  * New option to fd_dict_search: AVP_BY_STRUCT
+  * Improved compatibility with C++ compilers.
+  * Cleanups in sessions creation/destruction to avoid memory corruption under stress.
+  * Add support for "include" directive in freeDiameter.conf file.
+
+ -- Sebastien Decugis <sdecugis@freediameter.net>  Sun, 03 Mar 2013 07:40:43 +0100
+
 freediameter (1.1.5) UNRELEASED; urgency=low
 
   * Added compatibility with MAC OS X
--- a/contrib/debian/update_changelog.txt	Tue Mar 05 22:52:35 2013 +0100
+++ b/contrib/debian/update_changelog.txt	Wed Mar 06 20:09:54 2013 +0100
@@ -1,3 +1,3 @@
-new release: dch -v 1.0.3 -D UNRELEASED
+new release: dch -v 1.0.3 -D UNRELEASED --release-heuristic log
 Simple addition: dch "changelog entry text"
 
--- a/doc/freediameter.conf.sample	Tue Mar 05 22:52:35 2013 +0100
+++ b/doc/freediameter.conf.sample	Wed Mar 06 20:09:54 2013 +0100
@@ -2,6 +2,10 @@
 
 # Only the "TLS_Cred" directive is really mandatory in this file.
 
+# It is possible to use "include" keyword to import additional files
+# e.g.: include "/etc/freeDiameter.d/*.conf"
+
+
 ##############################################################
 ##  Peer identity and realm 
 
--- a/extensions/_sample/hello.cpp	Tue Mar 05 22:52:35 2013 +0100
+++ b/extensions/_sample/hello.cpp	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/extensions/acl_wl/aw_conf.l	Tue Mar 05 22:52:35 2013 +0100
+++ b/extensions/acl_wl/aw_conf.l	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
@@ -92,4 +92,11 @@
 				return FQDN;
 			}
 
+	/* No match */
+<*>[[:alnum:]]+		|	/* This rule is only useful to print a complete token in error messages */
+<*>.			{
+				TRACE_DEBUG_ERROR("Unrecognized text on line %d col %d: '%s'.\n", yylloc->first_line, yylloc->first_column, yytext);
+			 	return LEX_ERROR; 
+			}
+
 %%
--- a/extensions/acl_wl/aw_conf.y	Tue Mar 05 22:52:35 2013 +0100
+++ b/extensions/acl_wl/aw_conf.y	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
@@ -126,5 +126,10 @@
 			{
 				fqdn_added++;
 			}
+			| conffile LEX_ERROR
+			{
+				yyerror(&yylloc, conffile, "An error occurred while parsing the configuration file");
+				return EINVAL;
+			}
 			;
 
--- a/extensions/app_radgw/rgwx_auth.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/extensions/app_radgw/rgwx_auth.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/extensions/test_app/ta_bench.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/extensions/test_app/ta_bench.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/extensions/test_app/ta_cli.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/extensions/test_app/ta_cli.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
@@ -58,6 +58,8 @@
 	struct session * sess;
 	struct avp * avp;
 	struct avp_hdr * hdr;
+	unsigned long dur;
+	int error = 0;
 	
 	CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &ts), return );
 
@@ -79,9 +81,15 @@
 	CHECK_FCT_DO( fd_msg_search_avp ( *msg, ta_avp, &avp), return );
 	if (avp) {
 		CHECK_FCT_DO( fd_msg_avp_hdr( avp, &hdr ), return );
-		fprintf(stderr, "%x (%s) ", hdr->avp_value->i32, (hdr->avp_value->i32 == mi->randval) ? "Ok" : "PROBLEM");
+		if (hdr->avp_value->i32 == mi->randval) {
+			fprintf(stderr, "%x (%s) ", hdr->avp_value->i32, "Ok");
+		} else {
+			fprintf(stderr, "%x (%s) ", hdr->avp_value->i32, "PROBLEM");
+			error++;
+		}
 	} else {
 		fprintf(stderr, "no_Test-AVP ");
+		error++;
 	}
 	
 	/* Value of Result Code */
@@ -89,8 +97,11 @@
 	if (avp) {
 		CHECK_FCT_DO( fd_msg_avp_hdr( avp, &hdr ), return );
 		fprintf(stderr, "Status: %d ", hdr->avp_value->i32);
+		if (hdr->avp_value->i32 != 2001)
+			error++;
 	} else {
 		fprintf(stderr, "no_Result-Code ");
+		error++;
 	}
 	
 	/* Value of Origin-Host */
@@ -100,6 +111,7 @@
 		fprintf(stderr, "From '%.*s' ", (int)hdr->avp_value->os.len, hdr->avp_value->os.data);
 	} else {
 		fprintf(stderr, "no_Origin-Host ");
+		error++;
 	}
 	
 	/* Value of Origin-Realm */
@@ -109,9 +121,34 @@
 		fprintf(stderr, "('%.*s') ", (int)hdr->avp_value->os.len, hdr->avp_value->os.data);
 	} else {
 		fprintf(stderr, "no_Origin-Realm ");
+		error++;
 	}
 	
-	/* Now compute how long it took */
+	CHECK_POSIX_DO( pthread_mutex_lock(&ta_conf->stats_lock), );
+	dur = ((ts.tv_sec - mi->ts.tv_sec) * 1000000) + ((ts.tv_nsec - mi->ts.tv_nsec) / 1000);
+	if (ta_conf->stats.nb_recv) {
+		/* Ponderate in the avg */
+		ta_conf->stats.avg = (ta_conf->stats.avg * ta_conf->stats.nb_recv + dur) / (ta_conf->stats.nb_recv + 1);
+		/* Min, max */
+		if (dur < ta_conf->stats.shortest)
+			ta_conf->stats.shortest = dur;
+		if (dur > ta_conf->stats.longest)
+			ta_conf->stats.longest = dur;
+	} else {
+		ta_conf->stats.shortest = dur;
+		ta_conf->stats.longest = dur;
+		ta_conf->stats.avg = dur;
+	}
+	
+	if (error)
+		ta_conf->stats.nb_errs++;
+	else 
+		ta_conf->stats.nb_recv++;
+	
+	
+	CHECK_POSIX_DO( pthread_mutex_unlock(&ta_conf->stats_lock), );
+	
+	/* Display how long it took */
 	if (ts.tv_nsec > mi->ts.tv_nsec) {
 		fprintf(stderr, "in %d.%06ld sec", 
 				(int)(ts.tv_sec - mi->ts.tv_sec),
@@ -121,7 +158,6 @@
 				(int)(ts.tv_sec + 1 - mi->ts.tv_sec),
 				(long)(1000000000 + ts.tv_nsec - mi->ts.tv_nsec) / 1000);
 	}
-	
 	fprintf(stderr, "\n");
 	fflush(stderr);
 	
@@ -217,6 +253,11 @@
 	/* Send the request */
 	CHECK_FCT_DO( fd_msg_send( &req, ta_cb_ans, svg ), goto out );
 
+	/* Increment the counter */
+	CHECK_POSIX_DO( pthread_mutex_lock(&ta_conf->stats_lock), );
+	ta_conf->stats.nb_sent++;
+	CHECK_POSIX_DO( pthread_mutex_unlock(&ta_conf->stats_lock), );
+
 out:
 	return;
 }
--- a/freeDiameterd/main.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/freeDiameterd/main.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/include/freeDiameter/CMakeLists.txt	Tue Mar 05 22:52:35 2013 +0100
+++ b/include/freeDiameter/CMakeLists.txt	Wed Mar 06 20:09:54 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/extension.h	Tue Mar 05 22:52:35 2013 +0100
+++ b/include/freeDiameter/extension.h	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/include/freeDiameter/freeDiameter-host.h.in	Tue Mar 05 22:52:35 2013 +0100
+++ b/include/freeDiameter/freeDiameter-host.h.in	Wed Mar 06 20:09:54 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/include/freeDiameter/libfdproto.h	Tue Mar 05 22:52:35 2013 +0100
+++ b/include/freeDiameter/libfdproto.h	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdcore/cnxctx.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/cnxctx.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
@@ -560,6 +560,9 @@
 		if (cur->ifa_flags & IFF_LOOPBACK)
 			continue;
 		
+		if (cur->ifa_addr == NULL) /* may happen with ppp interfaces */
+			continue;
+		
 		if (fd_g_config->cnf_flags.no_ip4 && (cur->ifa_addr->sa_family == AF_INET))
 			continue;
 		
--- a/libfdcore/core.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/core.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdcore/dict_base_proto.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/dict_base_proto.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdcore/fdcore-internal.h	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/fdcore-internal.h	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdcore/fdd.l	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/fdd.l	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
@@ -66,17 +66,39 @@
 
 /* %option noinput ? */
 #define YY_NO_INPUT
+
+/* Additional for files inclusion */
+#include <glob.h>
+#include <string.h>
+
+#define MAX_NESTED_CONF_FILES	5
+
+struct nested_conffiles_t {
+	YY_BUFFER_STATE parent_level_state;
+	glob_t filelist;
+	int current_file;
+} nested_conffiles[MAX_NESTED_CONF_FILES];
+
+int current_nested_level = 0;
+
+int globerrfct(const char *epath, int eerrno)
+{
+	TRACE_DEBUG_ERROR("Failed to scan %s: %s\n", epath, strerror(eerrno));
+	return 1;
+}
+
 %}
 
 %option bison-bridge bison-locations
 %option noyywrap
 %option nounput
 
+%x in_include
+
 /* Quoted string. Multilines do not match. */
 qstring		\"[^\"\n]*\"
 
 %%
-
 <*>\n			{ 
 				/* Update the line count */
 				yylloc->first_line++; 
@@ -87,6 +109,114 @@
 <*>([[:space:]]{-}[\n])+	; /* Eat all spaces, not new lines */
 <*>#.*$			; /* Eat all comments */
 
+
+include		BEGIN(in_include);
+	/* Following an "include" keyword */
+<in_include>{
+{qstring}	{ /* Name of the file to include. This is directly sent to glob. */
+			int globerror=0;
+			char * buf = strdup(yytext+1);
+			if (buf[yyleng-2] != '"')
+			{
+				TRACE_DEBUG_ERROR("Unterminated string: %s\n", yytext);
+				return LEX_ERROR;
+			}
+			buf[yyleng-2] = '\0';
+
+			if (current_nested_level >= MAX_NESTED_CONF_FILES)
+			{
+				TRACE_DEBUG_ERROR("Too many recursion levels in configuration files includes\n");
+				return LEX_ERROR;
+			}
+
+			/* glob the include */
+			globerror = glob(buf, GLOB_ERR, globerrfct, &nested_conffiles[current_nested_level].filelist);
+
+			if (globerror == GLOB_NOSPACE)
+			{
+				TRACE_DEBUG_ERROR("Not enough memory to parse include directive.\n");
+				return LEX_ERROR;
+			}
+			if (globerror == GLOB_ABORTED)
+			{
+				TRACE_DEBUG_ERROR("An error was encountered in include directive.\n");
+				return LEX_ERROR;
+			}
+			if (globerror == GLOB_NOMATCH)
+			{
+				globfree(&nested_conffiles[current_nested_level].filelist);
+				goto nomatch;
+			}
+			if (globerror)
+			{
+				TRACE_DEBUG_ERROR("Unexpected error in glob (%d).\n", globerror);
+				return LEX_ERROR;
+			}
+
+			/* We have a list of files to include. */
+
+			/* save the current buffer for returning when this include has been parsed */
+			nested_conffiles[current_nested_level].parent_level_state = YY_CURRENT_BUFFER;
+
+			/* Start with the first match */
+			nested_conffiles[current_nested_level].current_file = 0;
+
+			yyin = fopen( nested_conffiles[current_nested_level].filelist.gl_pathv[0], "r" );
+
+			if ( ! yyin )
+			{
+				TRACE_DEBUG_ERROR("Error in %s: %s", nested_conffiles[current_nested_level].filelist.gl_pathv[0], strerror(errno));
+				return LEX_ERROR;
+			}
+
+			yy_switch_to_buffer(yy_create_buffer( yyin, YY_BUF_SIZE ));
+
+			/* In case of recursive includes */
+			current_nested_level++;
+
+nomatch:
+			BEGIN(INITIAL);
+		}
+}
+
+<<EOF>>	{
+			if (current_nested_level == 0)
+			{
+			      /* We are at the end of parsing */
+			      yyterminate();
+			}
+
+			/* Otherwise we are doing an include statement */
+			--current_nested_level;
+			yy_delete_buffer(YY_CURRENT_BUFFER);
+
+			/* Go to next file, if any */
+			nested_conffiles[current_nested_level].current_file++;
+			if ( nested_conffiles[current_nested_level].filelist.gl_pathv[nested_conffiles[current_nested_level].current_file] == NULL )
+			{
+				/* We have finished with this list of includes */
+				globfree(&nested_conffiles[current_nested_level].filelist);
+				yy_switch_to_buffer(nested_conffiles[current_nested_level].parent_level_state);
+			}
+			else
+			{
+				/* Proceed to next included file */
+				yyin = fopen( nested_conffiles[current_nested_level].filelist.gl_pathv[nested_conffiles[current_nested_level].current_file], "r" );
+
+				if ( ! yyin )
+				{
+					TRACE_DEBUG_ERROR("Error in %s: %s", nested_conffiles[current_nested_level].filelist.gl_pathv[nested_conffiles[current_nested_level].current_file], strerror(errno));
+					return LEX_ERROR;
+				}
+
+				yy_switch_to_buffer(yy_create_buffer( yyin, YY_BUF_SIZE ));
+
+				/* In case of recursive includes */
+				current_nested_level++;
+			}
+
+}
+
 {qstring}		{
 				/* First copy the string without the quotes for use in the yacc parser */
 				CHECK_MALLOC_DO(	yylval->string = strdup(yytext+1), /* This allocates one useless tail char but... it's easier :D */ 
--- a/libfdcore/fdd.y	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/fdd.y	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdcore/messages.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/messages.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdcore/p_cnx.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/p_cnx.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdcore/p_out.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/p_out.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdcore/p_psm.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/p_psm.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdcore/peers.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/peers.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
@@ -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 );
--- a/libfdcore/sctp.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/sctp.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdcore/server.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdcore/server.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdproto/dictionary.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdproto/dictionary.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdproto/fdproto-internal.h	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdproto/fdproto-internal.h	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdproto/log.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdproto/log.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdproto/messages.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdproto/messages.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdproto/msg_log.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdproto/msg_log.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/libfdproto/sessions.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/libfdproto/sessions.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2012, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
--- a/tests/testmesg.c	Tue Mar 05 22:52:35 2013 +0100
+++ b/tests/testmesg.c	Wed Mar 06 20:09:54 2013 +0100
@@ -2,7 +2,7 @@
 * Software License Agreement (BSD License)                                                               *
 * Author: Sebastien Decugis <sdecugis@freediameter.net>							 *
 *													 *
-* Copyright (c) 2011, WIDE Project and NICT								 *
+* Copyright (c) 2013, WIDE Project and NICT								 *
 * All rights reserved.											 *
 * 													 *
 * Redistribution and use of this software in source and binary forms, with or without modification, are  *
"Welcome to our mercurial repository"