Index: source/ariba/overlay/BaseOverlay.cpp
===================================================================
--- source/ariba/overlay/BaseOverlay.cpp	(revision 2802)
+++ source/ariba/overlay/BaseOverlay.cpp	(revision 2803)
@@ -108,4 +108,12 @@
 	logging_info( "leaving spovnet " << spovnetId );
 
+	logging_debug( "dropping all auto-links ..." );
+	
+	BOOST_FOREACH( LinkPair item, linkMapping ){
+		if( item.second.autolink ) 
+			dropLink( item.first );
+	}
+
+	logging_debug( "leaving overlay" );
 	// first, leave the overlay interface
 	overlayInterface->leaveOverlay();
@@ -880,9 +888,5 @@
 	// drop links after a timeout of 30s
 
-	// the macro gets confused if type is passed directly
-	// because of the comma in the pair definition
-	typedef pair<LinkID,LinkItem> pairitem; 
-
-	BOOST_FOREACH( pairitem item, linkMapping ){
+	BOOST_FOREACH( LinkPair item, linkMapping ){
 		if( item.second.autolink && difftime(now, item.second.lastuse) > 30)
 			oldlinks.push_back( item.first );
@@ -890,4 +894,5 @@
 
 	BOOST_FOREACH( const LinkID lnk, oldlinks ){
+		logging_debug( "auto-link " << lnk.toString() << " timed out and is getting dropped" );
 		dropLink( lnk );
 	}
Index: source/ariba/overlay/BaseOverlay.h
===================================================================
--- source/ariba/overlay/BaseOverlay.h	(revision 2802)
+++ source/ariba/overlay/BaseOverlay.h	(revision 2803)
@@ -348,6 +348,7 @@
 
 	typedef map<const LinkID, LinkItem> LinkMapping;
+	typedef pair<const LinkID,LinkItem> LinkPair;
 	LinkMapping linkMapping;
-
+	
 	// nodes with pending joines. TODO: should be cleaned every some seconds
 	// add timestamps to each, and check on occasion
