Fixed packet relaying.
[silc.git] / apps / silcd / packet_receive.c
index 972e60be2e268adcd5812d043e3030ad7ff944ed..5d21089e91d35b03ade0f5acc148bf001c9627ca 100644 (file)
@@ -73,7 +73,7 @@ void silc_server_notify(SilcServer server,
     if (dst_sock)
       /* Relay the packet */
       silc_server_relay_packet(server, dst_sock, idata->send_key,
-                              idata->hmac_receive, idata->psn_send++,
+                              idata->hmac_send, idata->psn_send++,
                               packet, TRUE);
   }
 
@@ -378,9 +378,6 @@ void silc_server_notify(SilcServer server,
       goto out;
     }
 
-    if (channel->topic && !strcmp(channel->topic, tmp))
-      goto out;
-
     if (!channel_id) {
       channel_id = silc_id_str2id(packet->dst_id, packet->dst_id_len,
                                  packet->dst_id_type);
@@ -400,6 +397,9 @@ void silc_server_notify(SilcServer server,
       }
     }
 
+    if (channel->topic && !strcmp(channel->topic, tmp))
+      goto out;
+
     /* Get user's channel entry and check that topic set is allowed. */
     if (!silc_server_client_on_channel(client, channel, &chl))
       goto out;