Ticket #2355: tor-03-abandon_old_bridges.patch

File tor-03-abandon_old_bridges.patch, 1.8 KB (added by anonym, 8 years ago)

Abandon current circuits when changing bridge settings.

  • src/or/config.c

    diff --git a/src/or/config.c b/src/or/config.c
    index c377c09..d093932 100644
    a b options_act(or_options_t *old_options) 
    11781178{
    11791179  config_line_t *cl;
    11801180  or_options_t *options = get_options();
     1181  int configured_bridges_changed = 0;
    11811182  int running_tor = options->command == CMD_RUN_TOR;
    11821183  char *msg;
    11831184
    options_act(or_options_t *old_options) 
    11891190  if (consider_adding_dir_authorities(options, old_options) < 0)
    11901191    return -1;
    11911192
    1192   if (options->Bridges) {
     1193  if ((!old_options && options->Bridges) ||
     1194      (old_options && !config_lines_eq(options->Bridges,
     1195                                       old_options->Bridges))) {
     1196    configured_bridges_changed = 1;
    11931197    clear_bridge_list();
    11941198    for (cl = options->Bridges; cl; cl = cl->next) {
    11951199      if (parse_bridge_line(cl->value, 0)<0) {
    options_act(or_options_t *old_options) 
    12991303                         options->ExcludeExitNodes) ||
    13001304        !routerset_equal(old_options->EntryNodes, options->EntryNodes) ||
    13011305        !routerset_equal(old_options->ExitNodes, options->ExitNodes) ||
    1302         options->StrictNodes != old_options->StrictNodes) {
     1306        options->StrictNodes != old_options->StrictNodes ||
     1307        !bool_eq(options->EffectiveUseBridges,
     1308                 old_options->EffectiveUseBridges) ||
     1309        configured_bridges_changed) {
    13031310      log_info(LD_CIRC,
    1304                "Changed to using entry guards, or changed preferred or "
    1305                "excluded node lists. Abandoning previous circuits.");
     1311               "Changed to using entry guards, changed bridge settings, or "
     1312               "changed preferred or excluded node lists. Abandoning "
     1313               "previous circuits.");
    13061314      circuit_mark_all_unused_circs();
    13071315      circuit_expire_all_dirty_circs();
    13081316      addressmap_clear_excluded_trackexithosts(options);