+ /* If the packet is coming from router then use the sender as the
+ origin of the the packet. If it came from router then check the real
+ sender of the packet and use that as he origin. */
+ if (sock->type == SILC_SOCKET_TYPE_SERVER) {
+ router_sock = sock;
+ router = sock->user_data;
+ } else {
+ void *sender_id = silc_id_str2id(packet->src_id, packet->src_id_len,
+ packet->src_id_type);
+ router = silc_idlist_find_server_by_id(server->global_list,
+ sender_id, NULL);
+ if (!router)
+ router = silc_idlist_find_server_by_id(server->local_list,
+ sender_id, NULL);
+ assert(router != NULL);
+ router_sock = sock;
+ silc_free(sender_id);
+ }