Mark outbound initiated server to server connections as local.
authorSkywing <skywing@valhallalegends.com>
Sat, 22 Nov 2008 02:24:07 +0000 (21:24 -0500)
committerSkywing <skywing@valhallalegends.com>
Sat, 22 Nov 2008 02:39:54 +0000 (21:39 -0500)
This fixes an issue where if a disconnect packet is received by the
server for an outbound silc connection (i.e. a server to server link)
and there is an outstanding async operation, such as an SKE or
connection auth, the server will corrupt the heap due to not properly
calling the async abort routine.

This issue would typically happen when we have a silcd setup to connect
to a remote router server, where both ends of the connection have public
keys configured, but the initiator server's IP is wrong.  In this case,
we will get past key exchange and then fail at the connection auth
packet, typically crashing the initiator silcd after heap corruption.

apps/silcd/server.c

index 5b655419693626fbce7bd382641c8292b2c52be4..0da85e541dd5f68025715da27cc3bb821bbfd00b 100644 (file)
@@ -1803,6 +1803,8 @@ void silc_server_start_key_exchange(SilcServerConnection sconn)
   }
   entry->server = server;
   entry->data.sconn = sconn;
+  entry->data.conn_type = SILC_CONN_UNKNOWN;
+  entry->data.status |= SILC_IDLIST_STATUS_LOCAL;
   silc_packet_set_context(sconn->sock, entry);
 
   SILC_LOG_DEBUG(("Created unknown connection %p", entry));