"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/core/or/circuitbuild.c" between
tor-0.4.5.7.tar.gz and tor-0.4.5.8.tar.gz

About: Tor is an anonymous Internet communication system - a network of virtual tunnels that allows people and groups to improve their privacy and security on the Internet.

circuitbuild.c  (tor-0.4.5.7):circuitbuild.c  (tor-0.4.5.8)
skipping to change at line 884 skipping to change at line 884
*cell_type_out = RELAY_COMMAND_EXTEND2; *cell_type_out = RELAY_COMMAND_EXTEND2;
*create_cell_type_out = CELL_CREATE2; *create_cell_type_out = CELL_CREATE2;
} else { } else {
/* XXXX030 Remove support for deciding to use TAP and EXTEND. */ /* XXXX030 Remove support for deciding to use TAP and EXTEND. */
*cell_type_out = RELAY_COMMAND_EXTEND; *cell_type_out = RELAY_COMMAND_EXTEND;
*create_cell_type_out = CELL_CREATE; *create_cell_type_out = CELL_CREATE;
} }
} }
/** /**
* Return true iff <b>purpose</b> is a purpose for a circuit which is * Return true iff <b>circ</b> is allowed
* allowed to have no guard configured, even if the circuit is multihop * to have no guard configured, even if the circuit is multihop
* and guards are enabled. * and guards are enabled.
*/ */
static int static int
circuit_purpose_may_omit_guard(int purpose) circuit_may_omit_guard(const origin_circuit_t *circ)
{ {
switch (purpose) { if (BUG(!circ))
return 0;
if (circ->first_hop_from_controller) {
/* The controller picked the first hop: that bypasses the guard system. */
return 1;
}
switch (circ->base_.purpose) {
case CIRCUIT_PURPOSE_TESTING: case CIRCUIT_PURPOSE_TESTING:
case CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT: case CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT:
/* Testing circuits may omit guards because they're measuring /* Testing circuits may omit guards because they're measuring
* liveness or performance, and don't want guards to interfere. */ * liveness or performance, and don't want guards to interfere. */
return 1; return 1;
default: default:
/* All other multihop circuits should use guards if guards are /* All other multihop circuits should use guards if guards are
* enabled. */ * enabled. */
return 0; return 0;
} }
skipping to change at line 1022 skipping to change at line 1030
* more hops: mark the circuit as finished, and perform the necessary * more hops: mark the circuit as finished, and perform the necessary
* bookkeeping. Return 0 on success; -reason on failure (if the circuit * bookkeeping. Return 0 on success; -reason on failure (if the circuit
* should be torn down). * should be torn down).
*/ */
static int static int
circuit_build_no_more_hops(origin_circuit_t *circ) circuit_build_no_more_hops(origin_circuit_t *circ)
{ {
guard_usable_t r; guard_usable_t r;
if (! circ->guard_state) { if (! circ->guard_state) {
if (circuit_get_cpath_len(circ) != 1 && if (circuit_get_cpath_len(circ) != 1 &&
! circuit_purpose_may_omit_guard(circ->base_.purpose) && ! circuit_may_omit_guard(circ) &&
get_options()->UseEntryGuards) { get_options()->UseEntryGuards) {
log_warn(LD_BUG, "%d-hop circuit %p with purpose %d has no " log_warn(LD_BUG, "%d-hop circuit %p with purpose %d has no "
"guard state", "guard state",
circuit_get_cpath_len(circ), circ, circ->base_.purpose); circuit_get_cpath_len(circ), circ, circ->base_.purpose);
} }
r = GUARD_USABLE_NOW; r = GUARD_USABLE_NOW;
} else { } else {
r = entry_guard_succeeded(&circ->guard_state); r = entry_guard_succeeded(&circ->guard_state);
} }
const int is_usable_for_streams = (r == GUARD_USABLE_NOW); const int is_usable_for_streams = (r == GUARD_USABLE_NOW);
 End of changes. 4 change blocks. 
5 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)