gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r13609 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r13609 - gnunet/src/dht
Date: Mon, 8 Nov 2010 11:35:29 +0100

Author: grothoff
Date: 2010-11-08 11:35:29 +0100 (Mon, 08 Nov 2010)
New Revision: 13609

Modified:
   gnunet/src/dht/gnunet-service-dht.c
Log:
allow not compiling malicious code

Modified: gnunet/src/dht/gnunet-service-dht.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht.c 2010-11-08 10:23:43 UTC (rev 13608)
+++ gnunet/src/dht/gnunet-service-dht.c 2010-11-08 10:35:29 UTC (rev 13609)
@@ -2587,9 +2587,10 @@
 
   put_msg = (const struct GNUNET_DHT_PutMessage *)msg;
   put_type = (enum GNUNET_BLOCK_Type) ntohl (put_msg->type);
-
+#if HAVE_MALICIOUS
   if (put_type == GNUNET_BLOCK_DHT_MALICIOUS_MESSAGE_TYPE)
     return;
+#endif
   data_size = ntohs (put_msg->header.size) - sizeof (struct 
GNUNET_DHT_PutMessage);
   ret = GNUNET_BLOCK_get_key (block_context,
                              put_type,
@@ -3843,6 +3844,7 @@
   return ret;
 }
 
+#if HAVE_MALICIOUS
 /**
  * Task to send a malicious put message across the network.
  *
@@ -3859,7 +3861,6 @@
 
   if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN)
     return;
-
   put_message.header.size = htons(sizeof(struct GNUNET_DHT_PutMessage));
   put_message.header.type = htons(GNUNET_MESSAGE_TYPE_DHT_PUT);
   put_message.type = htonl(GNUNET_BLOCK_DHT_MALICIOUS_MESSAGE_TYPE);
@@ -3883,9 +3884,9 @@
   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "%s:%s Sending malicious PUT message 
with hash %s\n", my_short_id, "DHT", GNUNET_h2s(&key));
   demultiplex_message(&put_message.header, &message_context);
   
GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS,
 malicious_put_frequency), &malicious_put_task, NULL);
-
 }
 
+
 /**
  * Task to send a malicious put message across the network.
  *
@@ -3927,7 +3928,9 @@
   demultiplex_message (&get_message.header, &message_context);
   
GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS,
 malicious_get_frequency), &malicious_get_task, NULL);
 }
+#endif
 
+
 /**
  * Iterator over hash map entries.
  *
@@ -4131,6 +4134,7 @@
     GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Sending self seeking find peer 
request!\n");
     GNUNET_SCHEDULER_add_now(&send_find_peer_message, NULL);
     break;
+#if HAVE_MALICIOUS
   case GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_GET:
     if (ntohs(dht_control_msg->variable) > 0)
       malicious_get_frequency = ntohs(dht_control_msg->variable);
@@ -4162,6 +4166,7 @@
     GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
               "%s:%s Initiating malicious DROP behavior\n", my_short_id, 
"DHT");
     break;
+#endif
   default:
     GNUNET_log(GNUNET_ERROR_TYPE_WARNING, 
               "%s:%s Unknown control command type `%d'!\n", 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]