Loading changes/ticket25573 0 → 100644 +5 −0 Original line number Diff line number Diff line o Minor features (controller): - For purposes of CIRC_BW-based dropped cell detection, track half-closed stream ids, and allow their ENDs, SENDMEs, DATA and path bias check cells to arrive without counting it as dropped until either the END arrvies, or the windows are empty. Closes ticket 25573. src/common/container.c +1 −1 Original line number Diff line number Diff line Loading @@ -628,7 +628,7 @@ smartlist_uniq(smartlist_t *sl, * less than member, and greater than 0 if key is greater then member. */ void * smartlist_bsearch(smartlist_t *sl, const void *key, smartlist_bsearch(const smartlist_t *sl, const void *key, int (*compare)(const void *key, const void **member)) { int found, idx; Loading src/common/container.h +1 −1 Original line number Diff line number Diff line Loading @@ -120,7 +120,7 @@ const uint8_t *smartlist_get_most_frequent_digest256(smartlist_t *sl); void smartlist_uniq_strings(smartlist_t *sl); void smartlist_uniq_digests(smartlist_t *sl); void smartlist_uniq_digests256(smartlist_t *sl); void *smartlist_bsearch(smartlist_t *sl, const void *key, void *smartlist_bsearch(const smartlist_t *sl, const void *key, int (*compare)(const void *key, const void **member)); int smartlist_bsearch_idx(const smartlist_t *sl, const void *key, int (*compare)(const void *key, const void **member), Loading src/or/circpathbias.c +63 −0 Original line number Diff line number Diff line Loading @@ -893,6 +893,7 @@ pathbias_check_probe_response(circuit_t *circ, const cell_t *cell) /* Check nonce */ if (ipv4_host == ocirc->pathbias_probe_nonce) { pathbias_mark_use_success(ocirc); circuit_read_valid_data(ocirc, rh.length); circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED); log_info(LD_CIRC, "Got valid path bias probe back for circ %d, stream %d.", Loading @@ -913,6 +914,68 @@ pathbias_check_probe_response(circuit_t *circ, const cell_t *cell) return -1; } /** * Check if a cell is counts as valid data for a circuit, * and if so, count it as valid. */ void pathbias_count_valid_cells(circuit_t *circ, const cell_t *cell) { origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ); relay_header_t rh; relay_header_unpack(&rh, cell->payload); /* Check to see if this is a cell from a previous connection, * or is a request to close the circuit. */ switch (rh.command) { case RELAY_COMMAND_TRUNCATED: /* Truncated cells can arrive on path bias circs. When they do, * just process them. This closes the circ, but it was junk anyway. * No reason to wait for the probe. */ circuit_read_valid_data(ocirc, rh.length); circuit_truncated(TO_ORIGIN_CIRCUIT(circ), get_uint8(cell->payload + RELAY_HEADER_SIZE)); break; case RELAY_COMMAND_END: if (connection_half_edge_is_valid_end(ocirc->half_streams, rh.stream_id)) { circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length); } break; case RELAY_COMMAND_DATA: if (connection_half_edge_is_valid_data(ocirc->half_streams, rh.stream_id)) { circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length); } break; case RELAY_COMMAND_SENDME: if (connection_half_edge_is_valid_sendme(ocirc->half_streams, rh.stream_id)) { circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length); } break; case RELAY_COMMAND_CONNECTED: if (connection_half_edge_is_valid_connected(ocirc->half_streams, rh.stream_id)) { circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length); } break; case RELAY_COMMAND_RESOLVED: if (connection_half_edge_is_valid_resolved(ocirc->half_streams, rh.stream_id)) { circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length); } break; } } /** * Check if a circuit was used and/or closed successfully. * Loading src/or/circpathbias.h +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ void pathbias_count_build_success(origin_circuit_t *circ); int pathbias_count_build_attempt(origin_circuit_t *circ); int pathbias_check_close(origin_circuit_t *circ, int reason); int pathbias_check_probe_response(circuit_t *circ, const cell_t *cell); void pathbias_count_valid_cells(circuit_t *circ, const cell_t *cell); void pathbias_count_use_attempt(origin_circuit_t *circ); void pathbias_mark_use_success(origin_circuit_t *circ); void pathbias_mark_use_rollback(origin_circuit_t *circ); Loading Loading
changes/ticket25573 0 → 100644 +5 −0 Original line number Diff line number Diff line o Minor features (controller): - For purposes of CIRC_BW-based dropped cell detection, track half-closed stream ids, and allow their ENDs, SENDMEs, DATA and path bias check cells to arrive without counting it as dropped until either the END arrvies, or the windows are empty. Closes ticket 25573.
src/common/container.c +1 −1 Original line number Diff line number Diff line Loading @@ -628,7 +628,7 @@ smartlist_uniq(smartlist_t *sl, * less than member, and greater than 0 if key is greater then member. */ void * smartlist_bsearch(smartlist_t *sl, const void *key, smartlist_bsearch(const smartlist_t *sl, const void *key, int (*compare)(const void *key, const void **member)) { int found, idx; Loading
src/common/container.h +1 −1 Original line number Diff line number Diff line Loading @@ -120,7 +120,7 @@ const uint8_t *smartlist_get_most_frequent_digest256(smartlist_t *sl); void smartlist_uniq_strings(smartlist_t *sl); void smartlist_uniq_digests(smartlist_t *sl); void smartlist_uniq_digests256(smartlist_t *sl); void *smartlist_bsearch(smartlist_t *sl, const void *key, void *smartlist_bsearch(const smartlist_t *sl, const void *key, int (*compare)(const void *key, const void **member)); int smartlist_bsearch_idx(const smartlist_t *sl, const void *key, int (*compare)(const void *key, const void **member), Loading
src/or/circpathbias.c +63 −0 Original line number Diff line number Diff line Loading @@ -893,6 +893,7 @@ pathbias_check_probe_response(circuit_t *circ, const cell_t *cell) /* Check nonce */ if (ipv4_host == ocirc->pathbias_probe_nonce) { pathbias_mark_use_success(ocirc); circuit_read_valid_data(ocirc, rh.length); circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED); log_info(LD_CIRC, "Got valid path bias probe back for circ %d, stream %d.", Loading @@ -913,6 +914,68 @@ pathbias_check_probe_response(circuit_t *circ, const cell_t *cell) return -1; } /** * Check if a cell is counts as valid data for a circuit, * and if so, count it as valid. */ void pathbias_count_valid_cells(circuit_t *circ, const cell_t *cell) { origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ); relay_header_t rh; relay_header_unpack(&rh, cell->payload); /* Check to see if this is a cell from a previous connection, * or is a request to close the circuit. */ switch (rh.command) { case RELAY_COMMAND_TRUNCATED: /* Truncated cells can arrive on path bias circs. When they do, * just process them. This closes the circ, but it was junk anyway. * No reason to wait for the probe. */ circuit_read_valid_data(ocirc, rh.length); circuit_truncated(TO_ORIGIN_CIRCUIT(circ), get_uint8(cell->payload + RELAY_HEADER_SIZE)); break; case RELAY_COMMAND_END: if (connection_half_edge_is_valid_end(ocirc->half_streams, rh.stream_id)) { circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length); } break; case RELAY_COMMAND_DATA: if (connection_half_edge_is_valid_data(ocirc->half_streams, rh.stream_id)) { circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length); } break; case RELAY_COMMAND_SENDME: if (connection_half_edge_is_valid_sendme(ocirc->half_streams, rh.stream_id)) { circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length); } break; case RELAY_COMMAND_CONNECTED: if (connection_half_edge_is_valid_connected(ocirc->half_streams, rh.stream_id)) { circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length); } break; case RELAY_COMMAND_RESOLVED: if (connection_half_edge_is_valid_resolved(ocirc->half_streams, rh.stream_id)) { circuit_read_valid_data(TO_ORIGIN_CIRCUIT(circ), rh.length); } break; } } /** * Check if a circuit was used and/or closed successfully. * Loading
src/or/circpathbias.h +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ void pathbias_count_build_success(origin_circuit_t *circ); int pathbias_count_build_attempt(origin_circuit_t *circ); int pathbias_check_close(origin_circuit_t *circ, int reason); int pathbias_check_probe_response(circuit_t *circ, const cell_t *cell); void pathbias_count_valid_cells(circuit_t *circ, const cell_t *cell); void pathbias_count_use_attempt(origin_circuit_t *circ); void pathbias_mark_use_success(origin_circuit_t *circ); void pathbias_mark_use_rollback(origin_circuit_t *circ); Loading