X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fsilcd%2Fpacket_send.c;h=7d7e0a5ec2627c27e3837978c96cfb9f57107a64;hb=ad84e8073e747c282e234e14e21a78bad24960cb;hp=b159c9314a66ea41108ddb1082739c8efc421b7c;hpb=f4bfb2bd7a663acfff720ee901463d370266a9c5;p=silc.git diff --git a/apps/silcd/packet_send.c b/apps/silcd/packet_send.c index b159c931..7d7e0a5e 100644 --- a/apps/silcd/packet_send.c +++ b/apps/silcd/packet_send.c @@ -97,7 +97,8 @@ void silc_server_packet_send(SilcServer server, return; /* If entry is disabled do not sent anything. */ - if (idata && idata->status & SILC_IDLIST_STATUS_DISABLED) { + if ((idata && idata->status & SILC_IDLIST_STATUS_DISABLED) || + sock->user_data == server->id_entry) { SILC_LOG_DEBUG(("Connection is disabled")); return; } @@ -159,7 +160,8 @@ void silc_server_packet_send_dest(SilcServer server, idata = (SilcIDListData)sock->user_data; /* If entry is disabled do not sent anything. */ - if (idata && idata->status & SILC_IDLIST_STATUS_DISABLED) { + if ((idata && idata->status & SILC_IDLIST_STATUS_DISABLED) || + sock->user_data == server->id_entry) { SILC_LOG_DEBUG(("Connection is disabled")); return; } @@ -257,6 +259,20 @@ void silc_server_packet_send_srcdest(SilcServer server, /* Get data used in the packet sending, keys and stuff */ idata = (SilcIDListData)sock->user_data; + /* If entry is disabled do not sent anything. */ + if ((idata && idata->status & SILC_IDLIST_STATUS_DISABLED) || + sock->user_data == server->id_entry) { + SILC_LOG_DEBUG(("Connection is disabled")); + return; + } + + if (idata) { + cipher = idata->send_key; + hmac = idata->hmac_send; + sequence = idata->psn_send++; + block_len = silc_cipher_get_block_len(cipher); + } + if (dst_id) { dst_id_data = silc_id_id2str(dst_id, dst_id_type); dst_id_len = silc_id_get_len(dst_id, dst_id_type); @@ -267,13 +283,6 @@ void silc_server_packet_send_srcdest(SilcServer server, src_id_len = silc_id_get_len(src_id, src_id_type); } - if (idata) { - cipher = idata->send_key; - hmac = idata->hmac_send; - sequence = idata->psn_send++; - block_len = silc_cipher_get_block_len(cipher); - } - /* Set the packet context pointers */ packetdata.type = type; packetdata.flags = flags;