aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_neighbours.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-28 13:21:05 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-28 13:21:05 +0000
commit90c8b6d3aee86a6ae12ad5ccf85e1de3769c86cc (patch)
tree7c4345885c7b2b695178e2946d1c1d24035b4648 /src/transport/gnunet-service-transport_neighbours.c
parentd8b7abbebb419f825b2bf412d7c7ecfa9db89541 (diff)
downloadgnunet-90c8b6d3aee86a6ae12ad5ccf85e1de3769c86cc.tar.gz
gnunet-90c8b6d3aee86a6ae12ad5ccf85e1de3769c86cc.zip
adding additional checks for invariants to help find #3690
Diffstat (limited to 'src/transport/gnunet-service-transport_neighbours.c')
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 7c596fbae..89a9a8b16 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -826,6 +826,9 @@ set_alternative_address (struct NeighbourMapEntry *n,
826 n->alternative_address.session = session; 826 n->alternative_address.session = session;
827 n->alternative_address.ats_active = GNUNET_NO; 827 n->alternative_address.ats_active = GNUNET_NO;
828 n->alternative_address.keep_alive_nonce = 0; 828 n->alternative_address.keep_alive_nonce = 0;
829 GNUNET_assert (GNUNET_YES ==
830 GST_ats_is_known (n->alternative_address.address,
831 n->alternative_address.session));
829} 832}
830 833
831 834
@@ -890,6 +893,9 @@ set_primary_address (struct NeighbourMapEntry *n,
890 n->primary_address.bandwidth_out = bandwidth_out; 893 n->primary_address.bandwidth_out = bandwidth_out;
891 n->primary_address.session = session; 894 n->primary_address.session = session;
892 n->primary_address.keep_alive_nonce = 0; 895 n->primary_address.keep_alive_nonce = 0;
896 GNUNET_assert (GNUNET_YES ==
897 GST_ats_is_known (n->primary_address.address,
898 n->primary_address.session));
893 /* subsystems about address use */ 899 /* subsystems about address use */
894 GST_validation_set_address_use (n->primary_address.address, 900 GST_validation_set_address_use (n->primary_address.address,
895 GNUNET_YES); 901 GNUNET_YES);
@@ -2455,6 +2461,9 @@ try_run_fast_ats_update (const struct GNUNET_HELLO_Address *address,
2455 /* switch to a different session, but keeping same address; could 2461 /* switch to a different session, but keeping same address; could
2456 happen if there is a 2nd inbound connection */ 2462 happen if there is a 2nd inbound connection */
2457 n->primary_address.session = session; 2463 n->primary_address.session = session;
2464 GNUNET_assert (GNUNET_YES ==
2465 GST_ats_is_known (n->primary_address.address,
2466 n->primary_address.session));
2458 } 2467 }
2459 n->primary_address.bandwidth_in = bandwidth_in; 2468 n->primary_address.bandwidth_in = bandwidth_in;
2460 n->primary_address.bandwidth_out = bandwidth_out; 2469 n->primary_address.bandwidth_out = bandwidth_out;
@@ -3398,6 +3407,9 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
3398 /* Destroy the inbound address since it cannot be used */ 3407 /* Destroy the inbound address since it cannot be used */
3399 free_address (&n->primary_address); 3408 free_address (&n->primary_address);
3400 n->primary_address = n->alternative_address; 3409 n->primary_address = n->alternative_address;
3410 GNUNET_assert (GNUNET_YES ==
3411 GST_ats_is_known (n->primary_address.address,
3412 n->primary_address.session));
3401 memset (&n->alternative_address, 3413 memset (&n->alternative_address,
3402 0, 3414 0,
3403 sizeof (struct NeighbourAddress)); 3415 sizeof (struct NeighbourAddress));