summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-communicator-udp.c
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2022-03-17 14:28:40 +0100
committert3sserakt <t3ss@posteo.de>2022-03-17 14:28:40 +0100
commit95a1edacccd9b3bf769a144a12d41946d0ac25dc (patch)
treeb84608361cd836d29649f076589dd42943d1301f /src/transport/gnunet-communicator-udp.c
parent16c9959d9b395b179446ee4a2cb70f3563c4fb20 (diff)
- Trying to exchange iptables with nft, first shot failed.
- Fixed small bug in UDP communicator. - Fixed bug in DV circle test case - Introduced a default value to wait for a reliability ack. - Introduced a FC retransmission threshold together with a retransmission count. - Introduced a original size value for TransportDVBoxMessage - Checking if we have the root pending messge, when removing the pending message from virtual link. - Added delay value to schedule_transmit_on_queue to wait for retransmitting. - Checking for confirmed virtual link, before routing. - Allow unconfirmed queues or DV routes when doing dv encapsulation for control traffic. - Changed check_vl_transmission to also check window size for DV next hop peer. - Fixed fragment box handling to also handle reliability boxed message which needed to be fragmented. - Fixed completing a message which was not only fragmented but also DV boxed. - Added logic to notify core about a new virtual link using distance vector without having validated next neighbour. - Added logic to create a virtual link to handle flow control messages. - fixed several smaller bugs in fragmentation logic. - Changed logic for adding the next_attempt value of PendingMessage.
Diffstat (limited to 'src/transport/gnunet-communicator-udp.c')
-rw-r--r--src/transport/gnunet-communicator-udp.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/transport/gnunet-communicator-udp.c b/src/transport/gnunet-communicator-udp.c
index b6edff485..70848ff79 100644
--- a/src/transport/gnunet-communicator-udp.c
+++ b/src/transport/gnunet-communicator-udp.c
@@ -1273,7 +1273,7 @@ pass_plaintext_to_core (struct SenderAddress *sender,
const struct GNUNET_MessageHeader *hdr = plaintext;
const char *pos = plaintext;
- while (ntohs (hdr->size) < plaintext_len)
+ while (ntohs (hdr->size) <= plaintext_len)
{
GNUNET_STATISTICS_update (stats,
"# bytes given to core",
@@ -1722,6 +1722,12 @@ try_handle_plaintext (struct SenderAddress *sender,
const struct UDPAck *ack = (const struct UDPAck *) buf;
uint16_t type;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "try_handle_plaintext of size %u (%u %u) and type %u\n",
+ buf_size,
+ ntohs (hdr->size),
+ sizeof(*hdr),
+ ntohs (hdr->type));
if (sizeof(*hdr) > buf_size)
return; /* not even a header */
if (ntohs (hdr->size) > buf_size)
@@ -2202,7 +2208,8 @@ verify_confirmation (const struct GNUNET_CRYPTO_EcdhePublicKey *ephemeral,
{
struct UdpHandshakeSignature uhs;
- uhs.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_HANDSHAKE);
+ uhs.purpose.purpose = htonl (
+ GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_HANDSHAKE);
uhs.purpose.size = htonl (sizeof(uhs));
uhs.sender = uc->sender;
uhs.receiver = my_identity;
@@ -2350,7 +2357,8 @@ sock_read (void *cls)
"received UDPBroadcast from %s\n",
GNUNET_a2s ((const struct sockaddr *) addr_verify, salen));
ub = (const struct UDPBroadcast *) buf;
- uhs.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST);
+ uhs.purpose.purpose = htonl (
+ GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST);
uhs.purpose.size = htonl (sizeof(uhs));
uhs.sender = ub->sender;
sender = ub->sender;
@@ -2366,10 +2374,11 @@ sock_read (void *cls)
GNUNET_i2s (&sender));
GNUNET_CRYPTO_hash ((struct sockaddr *) addr_verify, salen, &uhs.h_address);
if (GNUNET_OK ==
- GNUNET_CRYPTO_eddsa_verify (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST,
- &uhs,
- &ub->sender_sig,
- &ub->sender.public_key))
+ GNUNET_CRYPTO_eddsa_verify (
+ GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST,
+ &uhs,
+ &ub->sender_sig,
+ &ub->sender.public_key))
{
char *addr_s;
enum GNUNET_NetworkType nt;
@@ -2699,7 +2708,8 @@ mq_send_kx (struct GNUNET_MQ_Handle *mq,
uc.sender = my_identity;
uc.monotonic_time =
GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get_monotonic (cfg));
- uhs.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_HANDSHAKE);
+ uhs.purpose.purpose = htonl (
+ GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_HANDSHAKE);
uhs.purpose.size = htonl (sizeof(uhs));
uhs.sender = my_identity;
uhs.receiver = receiver->target;
@@ -3644,7 +3654,8 @@ iface_proc (void *cls,
bi->salen = addrlen;
bi->found = GNUNET_YES;
bi->bcm.sender = my_identity;
- ubs.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST);
+ ubs.purpose.purpose = htonl (
+ GNUNET_SIGNATURE_PURPOSE_COMMUNICATOR_UDP_BROADCAST);
ubs.purpose.size = htonl (sizeof(ubs));
ubs.sender = my_identity;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,