updates.
[silc.git] / apps / silcd / packet_send.c
index a5366eab918d410f404ad3b595fa7224f9e9d390..4519cc75446464e5cbc489dc90a6924d511030a7 100644 (file)
@@ -649,7 +649,7 @@ void silc_server_packet_send_to_channel(SilcServer server,
     sock = (SilcSocketConnection)client->connection;
     idata = (SilcIDListData)client;
     
-    if (sender && sock == sender)
+    if (!sock || (sender && sock == sender))
       continue;
 
     /* Send the packet */
@@ -710,7 +710,7 @@ silc_server_packet_relay_to_channel_encrypt(SilcServer server,
     chp = silc_channel_message_payload_encode(flags, dlen, data + 4,
                                              iv_len, channel->iv,
                                              channel->channel_key,
-                                             channel->hmac);
+                                             channel->hmac, NULL);
     memcpy(data, chp->data, chp->len);
     silc_buffer_free(chp);
   }
@@ -927,7 +927,7 @@ void silc_server_packet_relay_to_channel(SilcServer server,
     sock = (SilcSocketConnection)client->connection;
     idata = (SilcIDListData)client;
 
-    if (sender_sock && sock == sender_sock)
+    if (!sock || (sender_sock && sock == sender_sock))
       continue;
 
     SILC_LOG_DEBUG(("Sending packet to client ID(%s) %s (%s)", 
@@ -1596,6 +1596,9 @@ void silc_server_send_notify_on_channels(SilcServer server,
        sock = (SilcSocketConnection)c->connection;
        idata = (SilcIDListData)c;
        
+        if (!sock)
+          continue;
+
        packetdata.dst_id = silc_id_id2str(c->id, SILC_ID_CLIENT);
        packetdata.dst_id_len = silc_id_get_len(c->id, SILC_ID_CLIENT);
        packetdata.dst_id_type = SILC_ID_CLIENT;