Ticket #3216: 0001-Don-t-build-descriptors-if-ORPort-auto-is-set-and-we.patch

File 0001-Don-t-build-descriptors-if-ORPort-auto-is-set-and-we.patch, 1.7 KB (added by nickm, 8 years ago)
  • new file changes/bug3216

    From cd59dfd514387bdb5cc93ac2a037a8eb1d346d32 Mon Sep 17 00:00:00 2001
    From: Nick Mathewson <nickm@torproject.org>
    Date: Tue, 17 May 2011 21:42:35 -0400
    Subject: [PATCH 1/2] Don't build descriptors if ORPort auto is set and we
     have no OR listener
    
    This situation can happen easily if you set 'ORPort auto' and
    'AccountingMax'.  Doing so means that when you have no ORPort, you
    won't be able to set an ORPort in a descriptor, so instead you would
    just generate lots of invalid descriptors, freaking out all the time.
    
    Possible fix for 3216; fix on 0.2.2.26-beta.
    ---
     changes/bug3216 |    4 ++++
     src/or/router.c |    4 ++++
     2 files changed, 8 insertions(+), 0 deletions(-)
     create mode 100644 changes/bug3216
    
    diff --git a/changes/bug3216 b/changes/bug3216
    new file mode 100644
    index 0000000..599b5e1
    - +  
     1  o Major bugfixes:
     2    - Don't try to build descriptors if "ORPort auto" is set and we
     3      don't know our actual ORPort yet.  Fix for bug 3216; bugfix on
     4      0.2.2.26-beta.
  • src/or/router.c

    diff --git a/src/or/router.c b/src/or/router.c
    index 616a290..6a4664b 100644
    a b decide_to_advertise_dirport(or_options_t *options, uint16_t dir_port) 
    802802    return 0;
    803803  if (!check_whether_dirport_reachable())
    804804    return 0;
     805  if (!router_get_advertised_dir_port(options))
     806    return 0;
    805807
    806808  /* Section two: reasons to publish or not publish that the user
    807809   * might find surprising. These are generally config options that
    decide_if_publishable_server(void) 
    11361138    return 0;
    11371139  if (authdir_mode(options))
    11381140    return 1;
     1141  if (!router_get_advertised_or_port(options))
     1142    return 0;
    11391143
    11401144  return check_whether_orport_reachable();
    11411145}