diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-06-04 20:54:16 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-06-04 20:54:24 +0200 |
commit | 2cce8be6b8fcb2baa0d7abde4bbe486cbcb3f983 (patch) | |
tree | 28bde1eaa1de1f569404d879689a411d9cdbe678 /src/transport/gnunet-service-tng.c | |
parent | 18c183d3cb8f12790ed55333519b53a535a5c906 (diff) | |
download | gnunet-2cce8be6b8fcb2baa0d7abde4bbe486cbcb3f983.tar.gz gnunet-2cce8be6b8fcb2baa0d7abde4bbe486cbcb3f983.zip |
misc bugfixes
Diffstat (limited to 'src/transport/gnunet-service-tng.c')
-rw-r--r-- | src/transport/gnunet-service-tng.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index 7cc9f193c..9262e5e97 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -2980,7 +2980,8 @@ free_virtual_link (struct VirtualLink *vl) | |||
2980 | 2980 | ||
2981 | while (NULL != (pm = vl->pending_msg_head)) | 2981 | while (NULL != (pm = vl->pending_msg_head)) |
2982 | free_pending_message (pm); | 2982 | free_pending_message (pm); |
2983 | GNUNET_CONTAINER_multipeermap_remove (links, &vl->target, vl); | 2983 | GNUNET_assert (GNUNET_YES == |
2984 | GNUNET_CONTAINER_multipeermap_remove (links, &vl->target, vl)); | ||
2984 | if (NULL != vl->visibility_task) | 2985 | if (NULL != vl->visibility_task) |
2985 | { | 2986 | { |
2986 | GNUNET_SCHEDULER_cancel (vl->visibility_task); | 2987 | GNUNET_SCHEDULER_cancel (vl->visibility_task); |
@@ -3006,7 +3007,9 @@ free_virtual_link (struct VirtualLink *vl) | |||
3006 | static void | 3007 | static void |
3007 | free_validation_state (struct ValidationState *vs) | 3008 | free_validation_state (struct ValidationState *vs) |
3008 | { | 3009 | { |
3009 | GNUNET_CONTAINER_multipeermap_remove (validation_map, &vs->pid, vs); | 3010 | GNUNET_assert ( |
3011 | GNUNET_YES == | ||
3012 | GNUNET_CONTAINER_multipeermap_remove (validation_map, &vs->pid, vs)); | ||
3010 | GNUNET_CONTAINER_heap_remove_node (vs->hn); | 3013 | GNUNET_CONTAINER_heap_remove_node (vs->hn); |
3011 | vs->hn = NULL; | 3014 | vs->hn = NULL; |
3012 | if (NULL != vs->sc) | 3015 | if (NULL != vs->sc) |
@@ -4650,6 +4653,7 @@ route_control_message_without_fc (const struct GNUNET_PeerIdentity *target, | |||
4650 | struct DistanceVector *dv; | 4653 | struct DistanceVector *dv; |
4651 | 4654 | ||
4652 | vl = lookup_virtual_link (target); | 4655 | vl = lookup_virtual_link (target); |
4656 | GNUNET_assert (NULL != vl); | ||
4653 | n = vl->n; | 4657 | n = vl->n; |
4654 | dv = (0 != (options & RMO_DV_ALLOWED)) ? vl->dv : NULL; | 4658 | dv = (0 != (options & RMO_DV_ALLOWED)) ? vl->dv : NULL; |
4655 | if (0 == (options & RMO_UNCONFIRMED_ALLOWED)) | 4659 | if (0 == (options & RMO_UNCONFIRMED_ALLOWED)) |
@@ -5101,6 +5105,7 @@ handle_del_address (void *cls, | |||
5101 | const struct GNUNET_TRANSPORT_DelAddressMessage *dam) | 5105 | const struct GNUNET_TRANSPORT_DelAddressMessage *dam) |
5102 | { | 5106 | { |
5103 | struct TransportClient *tc = cls; | 5107 | struct TransportClient *tc = cls; |
5108 | struct AddressListEntry *alen; | ||
5104 | 5109 | ||
5105 | if (CT_COMMUNICATOR != tc->type) | 5110 | if (CT_COMMUNICATOR != tc->type) |
5106 | { | 5111 | { |
@@ -5110,8 +5115,9 @@ handle_del_address (void *cls, | |||
5110 | } | 5115 | } |
5111 | for (struct AddressListEntry *ale = tc->details.communicator.addr_head; | 5116 | for (struct AddressListEntry *ale = tc->details.communicator.addr_head; |
5112 | NULL != ale; | 5117 | NULL != ale; |
5113 | ale = ale->next) | 5118 | ale = alen) |
5114 | { | 5119 | { |
5120 | alen = ale->next; | ||
5115 | if (dam->aid != ale->aid) | 5121 | if (dam->aid != ale->aid) |
5116 | continue; | 5122 | continue; |
5117 | GNUNET_assert (ale->tc == tc); | 5123 | GNUNET_assert (ale->tc == tc); |
@@ -5515,10 +5521,10 @@ handle_fragment_box (void *cls, const struct TransportFragmentBoxMessage *fb) | |||
5515 | msize = ntohs (fb->msg_size); | 5521 | msize = ntohs (fb->msg_size); |
5516 | fc.message_uuid = fb->msg_uuid; | 5522 | fc.message_uuid = fb->msg_uuid; |
5517 | fc.rc = NULL; | 5523 | fc.rc = NULL; |
5518 | GNUNET_CONTAINER_multihashmap32_get_multiple (n->reassembly_map, | 5524 | (void) GNUNET_CONTAINER_multihashmap32_get_multiple (n->reassembly_map, |
5519 | fb->msg_uuid.uuid, | 5525 | fb->msg_uuid.uuid, |
5520 | &find_by_message_uuid, | 5526 | &find_by_message_uuid, |
5521 | &fc); | 5527 | &fc); |
5522 | if (NULL == (rc = fc.rc)) | 5528 | if (NULL == (rc = fc.rc)) |
5523 | { | 5529 | { |
5524 | rc = GNUNET_malloc (sizeof (*rc) + msize + /* reassembly payload buffer */ | 5530 | rc = GNUNET_malloc (sizeof (*rc) + msize + /* reassembly payload buffer */ |
@@ -7756,6 +7762,7 @@ handle_validation_challenge ( | |||
7756 | struct GNUNET_TIME_RelativeNBO validity_duration; | 7762 | struct GNUNET_TIME_RelativeNBO validity_duration; |
7757 | struct IncomingRequest *ir; | 7763 | struct IncomingRequest *ir; |
7758 | struct Neighbour *n; | 7764 | struct Neighbour *n; |
7765 | struct GNUNET_PeerIdentity sender; | ||
7759 | 7766 | ||
7760 | /* DV-routed messages are not allowed for validation challenges */ | 7767 | /* DV-routed messages are not allowed for validation challenges */ |
7761 | if (cmc->total_hops > 0) | 7768 | if (cmc->total_hops > 0) |
@@ -7794,9 +7801,9 @@ handle_validation_challenge ( | |||
7794 | route_control_message_without_fc (&cmc->im.sender, | 7801 | route_control_message_without_fc (&cmc->im.sender, |
7795 | &tvr.header, | 7802 | &tvr.header, |
7796 | RMO_ANYTHING_GOES | RMO_REDUNDANT); | 7803 | RMO_ANYTHING_GOES | RMO_REDUNDANT); |
7804 | sender = cmc->im.sender; | ||
7797 | finish_cmc_handling (cmc); | 7805 | finish_cmc_handling (cmc); |
7798 | 7806 | vl = lookup_virtual_link (&sender); | |
7799 | vl = lookup_virtual_link (&cmc->im.sender); | ||
7800 | if (NULL != vl) | 7807 | if (NULL != vl) |
7801 | return; | 7808 | return; |
7802 | 7809 | ||
@@ -7805,17 +7812,17 @@ handle_validation_challenge ( | |||
7805 | CORE), so we must try to bring the link up! */ | 7812 | CORE), so we must try to bring the link up! */ |
7806 | 7813 | ||
7807 | /* (1) Check existing queues, if any, we may be lucky! */ | 7814 | /* (1) Check existing queues, if any, we may be lucky! */ |
7808 | n = lookup_neighbour (&cmc->im.sender); | 7815 | n = lookup_neighbour (&sender); |
7809 | if (NULL != n) | 7816 | if (NULL != n) |
7810 | for (struct Queue *q = n->queue_head; NULL != q; q = q->next_neighbour) | 7817 | for (struct Queue *q = n->queue_head; NULL != q; q = q->next_neighbour) |
7811 | start_address_validation (&cmc->im.sender, q->address); | 7818 | start_address_validation (&sender, q->address); |
7812 | /* (2) Also try to see if we have addresses in PEERSTORE for this peer | 7819 | /* (2) Also try to see if we have addresses in PEERSTORE for this peer |
7813 | we could use */ | 7820 | we could use */ |
7814 | for (ir = ir_head; NULL != ir; ir = ir->next) | 7821 | for (ir = ir_head; NULL != ir; ir = ir->next) |
7815 | if (0 == GNUNET_memcmp (&ir->pid, &cmc->im.sender)) | 7822 | if (0 == GNUNET_memcmp (&ir->pid, &sender)) |
7816 | return; /* we are already trying */ | 7823 | return; /* we are already trying */ |
7817 | ir = GNUNET_new (struct IncomingRequest); | 7824 | ir = GNUNET_new (struct IncomingRequest); |
7818 | ir->pid = cmc->im.sender; | 7825 | ir->pid = sender; |
7819 | GNUNET_CONTAINER_DLL_insert (ir_head, ir_tail, ir); | 7826 | GNUNET_CONTAINER_DLL_insert (ir_head, ir_tail, ir); |
7820 | ir->wc = GNUNET_PEERSTORE_watch (peerstore, | 7827 | ir->wc = GNUNET_PEERSTORE_watch (peerstore, |
7821 | "transport", | 7828 | "transport", |
@@ -9190,6 +9197,7 @@ suggest_to_connect (const struct GNUNET_PeerIdentity *pid, const char *address) | |||
9190 | "Cannot connect to %s at `%s', no matching communicator present\n", | 9197 | "Cannot connect to %s at `%s', no matching communicator present\n", |
9191 | GNUNET_i2s (pid), | 9198 | GNUNET_i2s (pid), |
9192 | address); | 9199 | address); |
9200 | GNUNET_free (prefix); | ||
9193 | return; | 9201 | return; |
9194 | } | 9202 | } |
9195 | /* forward suggestion for queue creation to communicator */ | 9203 | /* forward suggestion for queue creation to communicator */ |
@@ -9198,6 +9206,7 @@ suggest_to_connect (const struct GNUNET_PeerIdentity *pid, const char *address) | |||
9198 | (unsigned int) idgen, | 9206 | (unsigned int) idgen, |
9199 | prefix, | 9207 | prefix, |
9200 | address); | 9208 | address); |
9209 | GNUNET_free (prefix); | ||
9201 | alen = strlen (address) + 1; | 9210 | alen = strlen (address) + 1; |
9202 | env = | 9211 | env = |
9203 | GNUNET_MQ_msg_extra (cqm, alen, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE); | 9212 | GNUNET_MQ_msg_extra (cqm, alen, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE); |