From: teor Date: Mon, 20 Jan 2020 05:50:54 +0000 (+1000) Subject: Merge branch 'ticket20218_rebased_squashed' into ticket20218_merged X-Git-Tag: tor-0.4.3.1-alpha~12^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3851128e886906aee5afa790c96f5b7dc2940454;p=thirdparty%2Ftor.git Merge branch 'ticket20218_rebased_squashed' into ticket20218_merged * ticket 32695 removed networkstatus_consensus_has_ipv6(), keep that change in master. * ticket 20218 modifies the function name and comment for routerstatus_has_visibly_changed(), keep that change in ticket20218_rebased_squashed. --- 3851128e886906aee5afa790c96f5b7dc2940454 diff --cc src/feature/nodelist/networkstatus.c index 58fad49a82,042852eb86..0d2ff96a6e --- a/src/feature/nodelist/networkstatus.c +++ b/src/feature/nodelist/networkstatus.c @@@ -1578,10 -1578,42 +1579,16 @@@ networkstatus_consensus_is_already_down return answer; } - /** Given two router status entries for the same router identity, return 1 if - * if the contents have changed between them. Otherwise, return 0. */ - static int - routerstatus_has_changed(const routerstatus_t *a, const routerstatus_t *b) -/* Does the current, reasonably live consensus have IPv6 addresses? - * Returns 1 if there is a reasonably live consensus and its consensus method - * includes IPv6 addresses in the consensus. - * Otherwise, if there is no consensus, or the method does not include IPv6 - * addresses, returns 0. */ -int -networkstatus_consensus_has_ipv6(const or_options_t* options) -{ - const networkstatus_t *cons = networkstatus_get_reasonably_live_consensus( - approx_time(), - usable_consensus_flavor()); - - /* If we have no consensus, we have no IPv6 in it */ - if (!cons) { - return 0; - } - - /* Different flavours of consensus gained IPv6 at different times */ - if (we_use_microdescriptors_for_circuits(options)) { - return - cons->consensus_method >= MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS; - } else { - return 1; - } -} - + /** Given two router status entries for the same router identity, return 1 + * if the contents have changed between them. Otherwise, return 0. + * It only checks for fields that are output by control port. + * This should be kept in sync with the struct routerstatus_t + * and the printing function routerstatus_format_entry in + * NS_CONTROL_PORT mode. + **/ + STATIC int + routerstatus_has_visibly_changed(const routerstatus_t *a, + const routerstatus_t *b) { tor_assert(tor_memeq(a->identity_digest, b->identity_digest, DIGEST_LEN));