gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r37499 - gnunet/src/fragmentation


From: gnunet
Subject: [GNUnet-SVN] r37499 - gnunet/src/fragmentation
Date: Fri, 8 Jul 2016 19:39:00 +0200

Author: grothoff
Date: 2016-07-08 19:38:59 +0200 (Fri, 08 Jul 2016)
New Revision: 37499

Modified:
   gnunet/src/fragmentation/fragmentation.c
   gnunet/src/fragmentation/fragmentation.h
Log:
fix sanitization issues

Modified: gnunet/src/fragmentation/fragmentation.c
===================================================================
--- gnunet/src/fragmentation/fragmentation.c    2016-07-08 17:20:54 UTC (rev 
37498)
+++ gnunet/src/fragmentation/fragmentation.c    2016-07-08 17:38:59 UTC (rev 
37499)
@@ -187,7 +187,7 @@
     return;                     /* all done */
   /* calculate delay */
   wrap = 0;
-  while (0 == (fc->acks & (1LL << fc->next_transmission)))
+  while (0 == (fc->acks & (1LLU << fc->next_transmission)))
   {
     fc->next_transmission = (fc->next_transmission + 1) % 64;
     wrap |= (0 == fc->next_transmission);
@@ -218,7 +218,7 @@
   }
   fc->next_transmission = (fc->next_transmission + 1) % 64;
   wrap |= (0 == fc->next_transmission);
-  while (0 == (fc->acks & (1LL << fc->next_transmission)))
+  while (0 == (fc->acks & (1LLU << fc->next_transmission)))
   {
     fc->next_transmission = (fc->next_transmission + 1) % 64;
     wrap |= (0 == fc->next_transmission);
@@ -348,7 +348,7 @@
   if (bits == 64)
     fc->acks_mask = UINT64_MAX; /* set all 64 bit */
   else
-    fc->acks_mask = (1LL << bits) - 1;  /* set lowest 'bits' bit */
+    fc->acks_mask = (1LLU << bits) - 1;  /* set lowest 'bits' bit */
   fc->acks = fc->acks_mask;
   fc->task = GNUNET_SCHEDULER_add_now (&transmit_next, fc);
   return fc;

Modified: gnunet/src/fragmentation/fragmentation.h
===================================================================
--- gnunet/src/fragmentation/fragmentation.h    2016-07-08 17:20:54 UTC (rev 
37498)
+++ gnunet/src/fragmentation/fragmentation.h    2016-07-08 17:38:59 UTC (rev 
37499)
@@ -44,18 +44,18 @@
   /**
    * Unique fragment ID.
    */
-  uint32_t fragment_id;
+  uint32_t fragment_id GNUNET_PACKED;
 
   /**
    * Total message size of the original message.
    */
-  uint16_t total_size;
+  uint16_t total_size GNUNET_PACKED;
 
   /**
    * Absolute offset (in bytes) of this fragment in the original
    * message.  Will be a multiple of the MTU.
    */
-  uint16_t offset;
+  uint16_t offset GNUNET_PACKED;
 
 };
 
@@ -74,7 +74,7 @@
   /**
    * Unique fragment ID.
    */
-  uint32_t fragment_id;
+  uint32_t fragment_id GNUNET_PACKED;
 
   /**
    * Bits that are being acknowledged, in big-endian.
@@ -81,7 +81,7 @@
    * (bits that are set correspond to fragments that
    * have not yet been received).
    */
-  uint64_t bits;
+  uint64_t bits GNUNET_PACKED;
 
 };
 GNUNET_NETWORK_STRUCT_END




reply via email to

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