diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-08 17:38:59 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-08 17:38:59 +0000 |
commit | 8a072a4db24fd858c1f0b4d2e07c3d2c877653f1 (patch) | |
tree | 6a3aaf930f15ed2fd28b00ffb7bcbfcd292b574b /src/fragmentation | |
parent | e153588726b9b3d409f0768c781885591b9141f7 (diff) | |
download | gnunet-8a072a4db24fd858c1f0b4d2e07c3d2c877653f1.tar.gz gnunet-8a072a4db24fd858c1f0b4d2e07c3d2c877653f1.zip |
fix sanitization issues
Diffstat (limited to 'src/fragmentation')
-rw-r--r-- | src/fragmentation/fragmentation.c | 6 | ||||
-rw-r--r-- | src/fragmentation/fragmentation.h | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c index 1c6b86e9e..21bbc538d 100644 --- a/src/fragmentation/fragmentation.c +++ b/src/fragmentation/fragmentation.c | |||
@@ -187,7 +187,7 @@ transmit_next (void *cls) | |||
187 | return; /* all done */ | 187 | return; /* all done */ |
188 | /* calculate delay */ | 188 | /* calculate delay */ |
189 | wrap = 0; | 189 | wrap = 0; |
190 | while (0 == (fc->acks & (1LL << fc->next_transmission))) | 190 | while (0 == (fc->acks & (1LLU << fc->next_transmission))) |
191 | { | 191 | { |
192 | fc->next_transmission = (fc->next_transmission + 1) % 64; | 192 | fc->next_transmission = (fc->next_transmission + 1) % 64; |
193 | wrap |= (0 == fc->next_transmission); | 193 | wrap |= (0 == fc->next_transmission); |
@@ -218,7 +218,7 @@ transmit_next (void *cls) | |||
218 | } | 218 | } |
219 | fc->next_transmission = (fc->next_transmission + 1) % 64; | 219 | fc->next_transmission = (fc->next_transmission + 1) % 64; |
220 | wrap |= (0 == fc->next_transmission); | 220 | wrap |= (0 == fc->next_transmission); |
221 | while (0 == (fc->acks & (1LL << fc->next_transmission))) | 221 | while (0 == (fc->acks & (1LLU << fc->next_transmission))) |
222 | { | 222 | { |
223 | fc->next_transmission = (fc->next_transmission + 1) % 64; | 223 | fc->next_transmission = (fc->next_transmission + 1) % 64; |
224 | wrap |= (0 == fc->next_transmission); | 224 | wrap |= (0 == fc->next_transmission); |
@@ -348,7 +348,7 @@ GNUNET_FRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, | |||
348 | if (bits == 64) | 348 | if (bits == 64) |
349 | fc->acks_mask = UINT64_MAX; /* set all 64 bit */ | 349 | fc->acks_mask = UINT64_MAX; /* set all 64 bit */ |
350 | else | 350 | else |
351 | fc->acks_mask = (1LL << bits) - 1; /* set lowest 'bits' bit */ | 351 | fc->acks_mask = (1LLU << bits) - 1; /* set lowest 'bits' bit */ |
352 | fc->acks = fc->acks_mask; | 352 | fc->acks = fc->acks_mask; |
353 | fc->task = GNUNET_SCHEDULER_add_now (&transmit_next, fc); | 353 | fc->task = GNUNET_SCHEDULER_add_now (&transmit_next, fc); |
354 | return fc; | 354 | return fc; |
diff --git a/src/fragmentation/fragmentation.h b/src/fragmentation/fragmentation.h index 5a75e988b..f585eb46b 100644 --- a/src/fragmentation/fragmentation.h +++ b/src/fragmentation/fragmentation.h | |||
@@ -44,18 +44,18 @@ struct FragmentHeader | |||
44 | /** | 44 | /** |
45 | * Unique fragment ID. | 45 | * Unique fragment ID. |
46 | */ | 46 | */ |
47 | uint32_t fragment_id; | 47 | uint32_t fragment_id GNUNET_PACKED; |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * Total message size of the original message. | 50 | * Total message size of the original message. |
51 | */ | 51 | */ |
52 | uint16_t total_size; | 52 | uint16_t total_size GNUNET_PACKED; |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * Absolute offset (in bytes) of this fragment in the original | 55 | * Absolute offset (in bytes) of this fragment in the original |
56 | * message. Will be a multiple of the MTU. | 56 | * message. Will be a multiple of the MTU. |
57 | */ | 57 | */ |
58 | uint16_t offset; | 58 | uint16_t offset GNUNET_PACKED; |
59 | 59 | ||
60 | }; | 60 | }; |
61 | 61 | ||
@@ -74,14 +74,14 @@ struct FragmentAcknowledgement | |||
74 | /** | 74 | /** |
75 | * Unique fragment ID. | 75 | * Unique fragment ID. |
76 | */ | 76 | */ |
77 | uint32_t fragment_id; | 77 | uint32_t fragment_id GNUNET_PACKED; |
78 | 78 | ||
79 | /** | 79 | /** |
80 | * Bits that are being acknowledged, in big-endian. | 80 | * Bits that are being acknowledged, in big-endian. |
81 | * (bits that are set correspond to fragments that | 81 | * (bits that are set correspond to fragments that |
82 | * have not yet been received). | 82 | * have not yet been received). |
83 | */ | 83 | */ |
84 | uint64_t bits; | 84 | uint64_t bits GNUNET_PACKED; |
85 | 85 | ||
86 | }; | 86 | }; |
87 | GNUNET_NETWORK_STRUCT_END | 87 | GNUNET_NETWORK_STRUCT_END |