diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/consensus/consensus_protocol.h | 18 | ||||
-rw-r--r-- | src/consensus/gnunet-service-consensus.c | 13 | ||||
-rw-r--r-- | src/dv/gnunet-service-dv.c | 4 |
3 files changed, 21 insertions, 14 deletions
diff --git a/src/consensus/consensus_protocol.h b/src/consensus/consensus_protocol.h index e0002de56..320d460c7 100644 --- a/src/consensus/consensus_protocol.h +++ b/src/consensus/consensus_protocol.h | |||
@@ -45,37 +45,37 @@ GNUNET_NETWORK_STRUCT_BEGIN | |||
45 | struct GNUNET_CONSENSUS_RoundContextMessage | 45 | struct GNUNET_CONSENSUS_RoundContextMessage |
46 | { | 46 | { |
47 | /** | 47 | /** |
48 | * Type: GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_ROUND_CONTEXT | 48 | * Type: #GNUNET_MESSAGE_TYPE_CONSENSUS_P2P_ROUND_CONTEXT |
49 | */ | 49 | */ |
50 | struct GNUNET_MessageHeader header; | 50 | struct GNUNET_MessageHeader header; |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * A value from 'enum PhaseKind'. | 53 | * A value from 'enum PhaseKind'. |
54 | */ | 54 | */ |
55 | uint16_t kind; | 55 | uint16_t kind GNUNET_PACKED; |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * Number of the first peer | 58 | * Number of the first peer |
59 | * in canonical order. | 59 | * in canonical order. |
60 | */ | 60 | */ |
61 | int16_t peer1; | 61 | int16_t peer1 GNUNET_PACKED; |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * Number of the second peer in canonical order. | 64 | * Number of the second peer in canonical order. |
65 | */ | 65 | */ |
66 | int16_t peer2; | 66 | int16_t peer2 GNUNET_PACKED; |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Repetition of the gradecast phase. | 69 | * Repetition of the gradecast phase. |
70 | */ | 70 | */ |
71 | int16_t repetition; | 71 | int16_t repetition GNUNET_PACKED; |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * Leader in the gradecast phase. | 74 | * Leader in the gradecast phase. |
75 | * | 75 | * |
76 | * Can be different from both peer1 and peer2. | 76 | * Can be different from both peer1 and peer2. |
77 | */ | 77 | */ |
78 | int16_t leader; | 78 | int16_t leader GNUNET_PACKED; |
79 | 79 | ||
80 | /** | 80 | /** |
81 | * Non-zero if this set reconciliation | 81 | * Non-zero if this set reconciliation |
@@ -85,7 +85,7 @@ struct GNUNET_CONSENSUS_RoundContextMessage | |||
85 | * | 85 | * |
86 | * Ignored for set operations that are not within gradecasts. | 86 | * Ignored for set operations that are not within gradecasts. |
87 | */ | 87 | */ |
88 | uint16_t is_contested; | 88 | uint16_t is_contested GNUNET_PACKED; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | 91 | ||
@@ -104,12 +104,12 @@ struct ConsensusElement | |||
104 | * Payload element_type, only valid | 104 | * Payload element_type, only valid |
105 | * if this is not a marker element. | 105 | * if this is not a marker element. |
106 | */ | 106 | */ |
107 | uint16_t payload_type; | 107 | uint16_t payload_type GNUNET_PACKED; |
108 | 108 | ||
109 | /** | 109 | /** |
110 | * Is this a marker element? | 110 | * Is this a marker element? |
111 | */ | 111 | */ |
112 | uint8_t marker; | 112 | uint8_t marker GNUNET_PACKED; |
113 | 113 | ||
114 | /* rest: element data */ | 114 | /* rest: element data */ |
115 | }; | 115 | }; |
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c index 7911db8b0..4af7199aa 100644 --- a/src/consensus/gnunet-service-consensus.c +++ b/src/consensus/gnunet-service-consensus.c | |||
@@ -1341,7 +1341,10 @@ commit_set (struct ConsensusSession *session, | |||
1341 | if (PHASE_KIND_ALL_TO_ALL_2 == task->key.kind) | 1341 | if (PHASE_KIND_ALL_TO_ALL_2 == task->key.kind) |
1342 | { | 1342 | { |
1343 | struct GNUNET_SET_Element element; | 1343 | struct GNUNET_SET_Element element; |
1344 | struct ConsensusSizeElement cse = { 0 }; | 1344 | struct ConsensusSizeElement cse = { |
1345 | .size = 0, | ||
1346 | .sender_index = 0 | ||
1347 | }; | ||
1345 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "inserting size marker\n"); | 1348 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "inserting size marker\n"); |
1346 | cse.ce.marker = CONSENSUS_MARKER_SIZE; | 1349 | cse.ce.marker = CONSENSUS_MARKER_SIZE; |
1347 | cse.size = GNUNET_htonll (session->first_size); | 1350 | cse.size = GNUNET_htonll (session->first_size); |
@@ -1394,7 +1397,10 @@ commit_set (struct ConsensusSession *session, | |||
1394 | for (i = 0; i < evil.num; i++) | 1397 | for (i = 0; i < evil.num; i++) |
1395 | { | 1398 | { |
1396 | struct GNUNET_SET_Element element; | 1399 | struct GNUNET_SET_Element element; |
1397 | struct ConsensusStuffedElement se = { 0 }; | 1400 | struct ConsensusStuffedElement se = { |
1401 | .ce.payload_type = 0, | ||
1402 | .ce.marker = 0, | ||
1403 | }; | ||
1398 | element.data = &se; | 1404 | element.data = &se; |
1399 | element.size = sizeof (struct ConsensusStuffedElement); | 1405 | element.size = sizeof (struct ConsensusStuffedElement); |
1400 | element.element_type = GNUNET_BLOCK_TYPE_CONSENSUS_ELEMENT; | 1406 | element.element_type = GNUNET_BLOCK_TYPE_CONSENSUS_ELEMENT; |
@@ -2123,7 +2129,7 @@ task_start_reconcile (struct TaskEntry *task) | |||
2123 | 2129 | ||
2124 | if (task->key.peer1 == session->local_peer_idx) | 2130 | if (task->key.peer1 == session->local_peer_idx) |
2125 | { | 2131 | { |
2126 | struct GNUNET_CONSENSUS_RoundContextMessage rcm = { 0 }; | 2132 | struct GNUNET_CONSENSUS_RoundContextMessage rcm; |
2127 | 2133 | ||
2128 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2134 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2129 | "P%u: Looking up set {%s} to run remote union\n", | 2135 | "P%u: Looking up set {%s} to run remote union\n", |
@@ -2138,6 +2144,7 @@ task_start_reconcile (struct TaskEntry *task) | |||
2138 | rcm.peer2 = htons (task->key.peer2); | 2144 | rcm.peer2 = htons (task->key.peer2); |
2139 | rcm.leader = htons (task->key.leader); | 2145 | rcm.leader = htons (task->key.leader); |
2140 | rcm.repetition = htons (task->key.repetition); | 2146 | rcm.repetition = htons (task->key.repetition); |
2147 | rcm.is_contested = htons (0); | ||
2141 | 2148 | ||
2142 | GNUNET_assert (NULL == setop->op); | 2149 | GNUNET_assert (NULL == setop->op); |
2143 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "P%u: initiating set op with P%u, our set is %s\n", | 2150 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "P%u: initiating set op with P%u, our set is %s\n", |
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 7d101c8ae..3fbd0cc03 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c | |||
@@ -1530,7 +1530,7 @@ listen_set_union (void *cls, | |||
1530 | GNUNET_SET_OPERATION_UNION); | 1530 | GNUNET_SET_OPERATION_UNION); |
1531 | neighbor->set_op = GNUNET_SET_accept (request, | 1531 | neighbor->set_op = GNUNET_SET_accept (request, |
1532 | GNUNET_SET_RESULT_ADDED, | 1532 | GNUNET_SET_RESULT_ADDED, |
1533 | (struct GNUNET_SET_Option[]) { 0 }, | 1533 | (struct GNUNET_SET_Option[]) {{ 0 }}, |
1534 | &handle_set_union_result, | 1534 | &handle_set_union_result, |
1535 | neighbor); | 1535 | neighbor); |
1536 | neighbor->consensus_insertion_offset = 0; | 1536 | neighbor->consensus_insertion_offset = 0; |
@@ -1561,7 +1561,7 @@ initiate_set_union (void *cls) | |||
1561 | &neighbor->real_session_id, | 1561 | &neighbor->real_session_id, |
1562 | NULL, | 1562 | NULL, |
1563 | GNUNET_SET_RESULT_ADDED, | 1563 | GNUNET_SET_RESULT_ADDED, |
1564 | (struct GNUNET_SET_Option[]) { 0 }, | 1564 | (struct GNUNET_SET_Option[]) {{ 0 }}, |
1565 | &handle_set_union_result, | 1565 | &handle_set_union_result, |
1566 | neighbor); | 1566 | neighbor); |
1567 | neighbor->consensus_insertion_offset = 0; | 1567 | neighbor->consensus_insertion_offset = 0; |