aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacki <jacki@thejackimonster.de>2024-10-02 23:49:33 +0200
committerJacki <jacki@thejackimonster.de>2024-10-02 23:49:33 +0200
commitd384ca1cb91f1f3482b28f576bd91e9c85ecf6b6 (patch)
treef839f9641f223f1b99d5ea289b6ae1384ebc3584
parent66ef7f442aa9d2d1abd83df502355faf5a9e4d04 (diff)
downloadgnunet-d384ca1cb91f1f3482b28f576bd91e9c85ecf6b6.tar.gz
gnunet-d384ca1cb91f1f3482b28f576bd91e9c85ecf6b6.zip
transport: cleanup virtual links on shutdown bypassing visibility tasks
Signed-off-by: Jacki <jacki@thejackimonster.de>
-rw-r--r--src/service/transport/gnunet-service-transport.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/service/transport/gnunet-service-transport.c b/src/service/transport/gnunet-service-transport.c
index e8cbf9ff3..bedd3fd4a 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -3727,9 +3727,11 @@ remove_global_addresses (void *cls,
3727 * Release memory used by @a neighbour. 3727 * Release memory used by @a neighbour.
3728 * 3728 *
3729 * @param neighbour neighbour entry to free 3729 * @param neighbour neighbour entry to free
3730 * @param drop_link flag to decide whether to drop its virtual link
3730 */ 3731 */
3731static void 3732static void
3732free_neighbour (struct Neighbour *neighbour) 3733free_neighbour (struct Neighbour *neighbour,
3734 enum GNUNET_GenericReturnValue drop_link)
3733{ 3735{
3734 struct DistanceVectorHop *dvh; 3736 struct DistanceVectorHop *dvh;
3735 struct VirtualLink *vl; 3737 struct VirtualLink *vl;
@@ -3769,7 +3771,7 @@ free_neighbour (struct Neighbour *neighbour)
3769 { 3771 {
3770 GNUNET_assert (neighbour == vl->n); 3772 GNUNET_assert (neighbour == vl->n);
3771 vl->n = NULL; 3773 vl->n = NULL;
3772 if (NULL == vl->dv) 3774 if ((GNUNET_YES == drop_link) || (NULL == vl->dv))
3773 { 3775 {
3774 cores_send_disconnect_info (&vl->target); 3776 cores_send_disconnect_info (&vl->target);
3775 free_virtual_link (vl); 3777 free_virtual_link (vl);
@@ -4082,7 +4084,7 @@ free_queue (struct Queue *queue)
4082 } 4084 }
4083 if (NULL == neighbour->queue_head) 4085 if (NULL == neighbour->queue_head)
4084 { 4086 {
4085 free_neighbour (neighbour); 4087 free_neighbour (neighbour, GNUNET_NO);
4086 } 4088 }
4087} 4089}
4088 4090
@@ -12772,7 +12774,7 @@ free_neighbour_cb (void *cls,
12772 (void) cls; 12774 (void) cls;
12773 (void) pid; 12775 (void) pid;
12774 GNUNET_break (0); // should this ever happen? 12776 GNUNET_break (0); // should this ever happen?
12775 free_neighbour (neighbour); 12777 free_neighbour (neighbour, GNUNET_YES);
12776 12778
12777 return GNUNET_OK; 12779 return GNUNET_OK;
12778} 12780}