From 95a1edacccd9b3bf769a144a12d41946d0ac25dc Mon Sep 17 00:00:00 2001 From: t3sserakt Date: Thu, 17 Mar 2022 14:28:40 +0100 Subject: - 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. --- src/transport/gnunet-communicator-udp.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/transport/gnunet-communicator-udp.c') 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, -- cgit v1.2.3