Просмотр исходного кода

totemknet: Check received message size - DO NOT MERGE - BREAKS ONWIRE (part 2)

check the size also in dst_host_filter_fn

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Fabio M. Di Nitto 6 лет назад
Родитель
Сommit
df9c41c14e
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      exec/totemknet.c

+ 5 - 0
exec/totemknet.c

@@ -302,9 +302,14 @@ static int dst_host_filter_callback_fn(void *private_data,
 				       knet_node_id_t *dst_host_ids,
 				       knet_node_id_t *dst_host_ids,
 				       size_t *dst_host_ids_entries)
 				       size_t *dst_host_ids_entries)
 {
 {
+	struct totemknet_instance *instance = (struct totemknet_instance *)private_data;
 	struct totem_message_header *header = (struct totem_message_header *)outdata;
 	struct totem_message_header *header = (struct totem_message_header *)outdata;
 	int res;
 	int res;
 
 
+	if (outdata_len != header->expected_msg_size) {
+		knet_log_printf (LOGSYS_LEVEL_DEBUG, "DEBUG: dst_host_filter missing bytes in %u: received: %zu expected: %u", tx_rx, outdata_len, header->expected_msg_size);
+		assert(0);
+	}
 #ifdef HAVE_LIBNOZZLE
 #ifdef HAVE_LIBNOZZLE
 	if (*channel != 0) {
 	if (*channel != 0) {
 		return ether_host_filter_fn(private_data,
 		return ether_host_filter_fn(private_data,