diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-08-18 19:00:12 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-08-18 19:00:12 +0200 |
commit | 5a8b9a11a3050c91d99b43e4b2635d508385fc54 (patch) | |
tree | 1019051bc17333a50d0a2388880530fe97c6c34f /src/dht/gnunet-service-dht_neighbours.c | |
parent | ead0a3eec4d60193b1c157e74452ae888fddf2fb (diff) | |
download | gnunet-5a8b9a11a3050c91d99b43e4b2635d508385fc54.tar.gz gnunet-5a8b9a11a3050c91d99b43e4b2635d508385fc54.zip |
only 16 bit for options
Diffstat (limited to 'src/dht/gnunet-service-dht_neighbours.c')
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index cc7333a9c..8611f2653 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -176,9 +176,14 @@ struct PeerResultMessage | |||
176 | uint32_t type GNUNET_PACKED; | 176 | uint32_t type GNUNET_PACKED; |
177 | 177 | ||
178 | /** | 178 | /** |
179 | * Always 0. | ||
180 | */ | ||
181 | uint16_t reserved GNUNET_PACKED; | ||
182 | |||
183 | /** | ||
179 | * Message options, actually an 'enum GNUNET_DHT_RouteOption' value in NBO. | 184 | * Message options, actually an 'enum GNUNET_DHT_RouteOption' value in NBO. |
180 | */ | 185 | */ |
181 | uint32_t options GNUNET_PACKED; | 186 | uint16_t options GNUNET_PACKED; |
182 | 187 | ||
183 | /** | 188 | /** |
184 | * Length of the PUT path that follows (if tracked). | 189 | * Length of the PUT path that follows (if tracked). |
@@ -1771,7 +1776,7 @@ GDS_NEIGHBOURS_handle_reply (struct PeerInfo *pi, | |||
1771 | prm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_RESULT); | 1776 | prm->header.type = htons (GNUNET_MESSAGE_TYPE_DHT_P2P_RESULT); |
1772 | prm->header.size = htons (sizeof (buf)); | 1777 | prm->header.size = htons (sizeof (buf)); |
1773 | prm->type = htonl ((uint32_t) bd->type); | 1778 | prm->type = htonl ((uint32_t) bd->type); |
1774 | prm->options = htonl ((uint32_t) ro); | 1779 | prm->options = htons ((uint32_t) ro); |
1775 | prm->put_path_length = htons ((uint16_t) ppl); | 1780 | prm->put_path_length = htons ((uint16_t) ppl); |
1776 | prm->get_path_length = htons ((uint16_t) get_path_length); | 1781 | prm->get_path_length = htons ((uint16_t) get_path_length); |
1777 | prm->expiration_time = GNUNET_TIME_absolute_hton (bd->expiration_time); | 1782 | prm->expiration_time = GNUNET_TIME_absolute_hton (bd->expiration_time); |
@@ -2538,7 +2543,7 @@ handle_dht_p2p_result (void *cls, | |||
2538 | struct PeerInfo *peer = t->pi; | 2543 | struct PeerInfo *peer = t->pi; |
2539 | uint16_t msize = ntohs (prm->header.size) - sizeof (*prm); | 2544 | uint16_t msize = ntohs (prm->header.size) - sizeof (*prm); |
2540 | enum GNUNET_DHT_RouteOption ro | 2545 | enum GNUNET_DHT_RouteOption ro |
2541 | = (enum GNUNET_DHT_RouteOption) ntohl (prm->options); | 2546 | = (enum GNUNET_DHT_RouteOption) ntohs (prm->options); |
2542 | bool truncated = (0 != (ro & GNUNET_DHT_RO_TRUNCATED)); | 2547 | bool truncated = (0 != (ro & GNUNET_DHT_RO_TRUNCATED)); |
2543 | bool tracked = (0 != (ro & GNUNET_DHT_RO_RECORD_ROUTE)); | 2548 | bool tracked = (0 != (ro & GNUNET_DHT_RO_RECORD_ROUTE)); |
2544 | uint16_t get_path_length = ntohs (prm->get_path_length); | 2549 | uint16_t get_path_length = ntohs (prm->get_path_length); |