diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-06-26 10:50:30 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-06-26 10:50:30 +0000 |
commit | 05a33ac60359d249127dc52502e8bca792383869 (patch) | |
tree | 92fed8c3bbb983011980124496242e3dd94de891 /src/transport | |
parent | e81a085db0c1e50727097b60124e9c590ab01baa (diff) | |
download | gnunet-05a33ac60359d249127dc52502e8bca792383869.tar.gz gnunet-05a33ac60359d249127dc52502e8bca792383869.zip |
detecting duplicate connects
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 6c51d20d8..56c5ed446 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -763,6 +763,12 @@ set_alternative_address (struct NeighbourMapEntry *n, | |||
763 | n->alternative_address.keep_alive_nonce = 0; | 763 | n->alternative_address.keep_alive_nonce = 0; |
764 | } | 764 | } |
765 | 765 | ||
766 | static void | ||
767 | set_quotas () | ||
768 | { | ||
769 | |||
770 | } | ||
771 | |||
766 | 772 | ||
767 | /** | 773 | /** |
768 | * Initialize the primary address of a neighbour | 774 | * Initialize the primary address of a neighbour |
@@ -2506,6 +2512,16 @@ switch_address_bl_check_cont (void *cls, | |||
2506 | return; | 2512 | return; |
2507 | } | 2513 | } |
2508 | 2514 | ||
2515 | if ( (NULL != n->primary_address.address) && | ||
2516 | (0 == GNUNET_HELLO_address_cmp(blc_ctx->address, n->primary_address.address)) ) | ||
2517 | { | ||
2518 | if (blc_ctx->session == n->primary_address.session) | ||
2519 | { | ||
2520 | /* Same address, update only quotas */ | ||
2521 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Update with same address!\n"); | ||
2522 | } | ||
2523 | } | ||
2524 | |||
2509 | switch (n->state) | 2525 | switch (n->state) |
2510 | { | 2526 | { |
2511 | case GNUNET_TRANSPORT_PS_NOT_CONNECTED: | 2527 | case GNUNET_TRANSPORT_PS_NOT_CONNECTED: |
@@ -2721,12 +2737,11 @@ GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | |||
2721 | 2737 | ||
2722 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 2738 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
2723 | "ATS suggests %s address '%s' session %p for " | 2739 | "ATS suggests %s address '%s' session %p for " |
2724 | "peer `%s' in state %s/%s (quota in/out %u %u )\n", | 2740 | "peer `%s' in state %s/%s \n", |
2725 | GNUNET_HELLO_address_check_option (address, | 2741 | GNUNET_HELLO_address_check_option (address, |
2726 | GNUNET_HELLO_ADDRESS_INFO_INBOUND) ? "inbound" : "outbound", | 2742 | GNUNET_HELLO_ADDRESS_INFO_INBOUND) ? "inbound" : "outbound", |
2727 | GST_plugins_a2s (address), session, GNUNET_i2s (peer), | 2743 | GST_plugins_a2s (address), session, GNUNET_i2s (peer), |
2728 | GNUNET_TRANSPORT_ps2s (n->state), print_ack_state (n->ack_state), | 2744 | GNUNET_TRANSPORT_ps2s (n->state), print_ack_state (n->ack_state)); |
2729 | ntohl (bandwidth_in.value__), ntohl (bandwidth_out.value__)); | ||
2730 | 2745 | ||
2731 | /* Perform blacklist check */ | 2746 | /* Perform blacklist check */ |
2732 | blc_ctx = GNUNET_new (struct BlacklistCheckSwitchContext); | 2747 | blc_ctx = GNUNET_new (struct BlacklistCheckSwitchContext); |