Index: extensions/app_radgw/rgw_main.c
===================================================================
--- extensions/app_radgw/rgw_main.c	(revision 741)
+++ extensions/app_radgw/rgw_main.c	(revision 1124)
@@ -48,5 +48,5 @@
 	CHECK_FCT( rgw_conf_handle(conffile) );
 	
-	TRACE_DEBUG(INFO, "Extension RADIUS Gateway initialized with configuration: '%s'", conffile);
+	LOG_D( "Extension RADIUS Gateway initialized with configuration: '%s'", conffile);
 	rgw_servers_dump();
 	rgw_clients_dump();
Index: extensions/app_radgw/rgw_servers.c
===================================================================
--- extensions/app_radgw/rgw_servers.c	(revision 1107)
+++ extensions/app_radgw/rgw_servers.c	(revision 1124)
@@ -49,26 +49,23 @@
 	char ipstr[INET6_ADDRSTRLEN];
 	
-	if ( ! TRACE_BOOL(FULL) )
-		return;
-	
-	fd_log_debug(" auth server:");
-	fd_log_debug("    disabled..... : %s", rgw_servers.auth_serv.disabled ? "TRUE":"false");
-	fd_log_debug("    IP disabled.. : %s", rgw_servers.auth_serv.ip_disabled ? "TRUE":"false");
-	fd_log_debug("    IPv6 disabled : %s", rgw_servers.auth_serv.ip6_disabled ? "TRUE":"false");
-	fd_log_debug("    port......... : %hu", ntohs(rgw_servers.auth_serv.port));
+	LOG_D(" auth server:");
+	LOG_D("    disabled..... : %s", rgw_servers.auth_serv.disabled ? "TRUE":"false");
+	LOG_D("    IP disabled.. : %s", rgw_servers.auth_serv.ip_disabled ? "TRUE":"false");
+	LOG_D("    IPv6 disabled : %s", rgw_servers.auth_serv.ip6_disabled ? "TRUE":"false");
+	LOG_D("    port......... : %hu", ntohs(rgw_servers.auth_serv.port));
 	inet_ntop(AF_INET, &rgw_servers.auth_serv.ip_endpoint,ipstr,sizeof(ipstr));
-	fd_log_debug("    IP bind...... : %s", ipstr);
+	LOG_D("    IP bind...... : %s", ipstr);
 	inet_ntop(AF_INET6, &rgw_servers.auth_serv.ip6_endpoint,ipstr,sizeof(ipstr));
-	fd_log_debug("    IPv6 bind.... : %s", ipstr);
-
-	fd_log_debug(" acct server:");
-	fd_log_debug("    disabled..... : %s", rgw_servers.acct_serv.disabled ? "TRUE":"false");
-	fd_log_debug("    IP disabled.. : %s", rgw_servers.acct_serv.ip_disabled ? "TRUE":"false");
-	fd_log_debug("    IPv6 disabled : %s", rgw_servers.acct_serv.ip6_disabled ? "TRUE":"false");
-	fd_log_debug("    port......... : %hu", ntohs(rgw_servers.acct_serv.port));
+	LOG_D("    IPv6 bind.... : %s", ipstr);
+
+	LOG_D(" acct server:");
+	LOG_D("    disabled..... : %s", rgw_servers.acct_serv.disabled ? "TRUE":"false");
+	LOG_D("    IP disabled.. : %s", rgw_servers.acct_serv.ip_disabled ? "TRUE":"false");
+	LOG_D("    IPv6 disabled : %s", rgw_servers.acct_serv.ip6_disabled ? "TRUE":"false");
+	LOG_D("    port......... : %hu", ntohs(rgw_servers.acct_serv.port));
 	inet_ntop(AF_INET, &rgw_servers.acct_serv.ip_endpoint,ipstr,sizeof(ipstr));
-	fd_log_debug("    IP bind...... : %s", ipstr);
+	LOG_D("    IP bind...... : %s", ipstr);
 	inet_ntop(AF_INET6, &rgw_servers.acct_serv.ip6_endpoint,ipstr,sizeof(ipstr));
-	fd_log_debug("    IPv6 bind.... : %s", ipstr);
+	LOG_D("    IPv6 bind.... : %s", ipstr);
 
 }
@@ -125,20 +122,17 @@
 		
 		/* Get the port */
-		if (from.ss_family == AF_INET)
-			port = ((struct sockaddr_in *)&from)->sin_port;
-		if (from.ss_family == AF_INET6)
-			port = ((struct sockaddr_in6 *)&from)->sin6_port;
+		port = sSAport(&from);
 		if (!port) {
-			TRACE_DEBUG(INFO, "Invalid port (family: %d), discarding received %d bytes...", from.ss_family, len);
+			LOG_E("Invalid port (family: %d), discarding received %d bytes...", from.ss_family, len);
 			continue;
 		}
 		
 		fd_sa_sdump_numeric(sa_buf, (sSA*)&from);
-		TRACE_DEBUG(FULL, "Received %d bytes from %s", len, sa_buf);
+		LOG_D("RADIUS: RCV %dB from %s", len, sa_buf);
 		
 		/* Search the associated client definition, if any */
 		CHECK_FCT_DO( rgw_clients_search((struct sockaddr *) &from, &nas_info),
 			{
-				TRACE_NOTICE("Discarding %d bytes received from unknown IP: %s", len, sa_buf);
+				LOG_E("Discarding %d bytes received from unknown IP: %s", len, sa_buf);
 				continue;
 			} );
@@ -151,5 +145,5 @@
 				size_t clisz;
 				CHECK_FCT_DO( rgw_clients_get_origin(nas_info, &cliname, &clisz, NULL, NULL), );
-				TRACE_DEBUG(INFO, "Discarding invalid RADIUS message from '%s'", cliname);
+				LOG_E( "Discarding invalid RADIUS message from '%s'", cliname);
 				rgw_clients_dispose(&nas_info);
 				continue; 
@@ -258,5 +252,5 @@
 	
 	if (!ret) {
-		TRACE_DEBUG(INFO, "Trying to send a message from a disabled server: %s / %s", 
+		LOG_E( "Trying to send a message from a disabled server: %s / %s", 
 				(type == RGW_PLG_TYPE_AUTH) ? "Auth" : "Acct",
 				(to->sa_family == AF_INET)  ? "IP (v4)" : "IPv6");
@@ -275,6 +269,6 @@
 	
 	fd_sa_sdump_numeric(sa_buf, (sSA*)&sto);
-	TRACE_DEBUG(FULL, "Sending %zd bytes to %s", buflen, sa_buf);
-		
+	LOG_D("RADIUS: SND %zdB   to %s", buflen, sa_buf);
+	
 	/* Send */
 	ret = sendto(SERVERS[idx].sock, buf, buflen, 0, (struct sockaddr *)&sto, sSAlen(&sto));
Index: extensions/app_radgw/rgw_worker.c
===================================================================
--- extensions/app_radgw/rgw_worker.c	(revision 996)
+++ extensions/app_radgw/rgw_worker.c	(revision 1124)
@@ -247,4 +247,5 @@
 					switch (ahdr->avp_code) {
 						/* A few AVPs can be safely ignored here: */
+						case DIAM_ATTR_SESSION_ID:
 						case DIAM_ATTR_ROUTE_RECORD:
 						case DIAM_ATTR_PROXY_INFO:
@@ -255,5 +256,5 @@
 
 						default:
-							TRACE_DEBUG(FULL, "Remaining Mandatory AVP, code %d", ahdr->avp_code);
+							LOG_D("Remaining Mandatory AVP, code %d", ahdr->avp_code);
 							pb++;
 					}
