1. 15 Nov, 2012 5 commits
    • Nick Mathewson's avatar
      Fix a bug in policy_is_reject_star() that was making IPv4 exits break · bb2145b4
      Nick Mathewson authored
      IPv4-only exits have an implicit "reject [::]/0", which was making
      policy_is_reject_star() return 1 for them, making us refuse to do
      hostname lookups.
      This fix chanes policy_is_reject_star() to ask about which family we meant.
    • Nick Mathewson's avatar
      Add an IPv6Exit configuration option · 9016d9e8
      Nick Mathewson authored
      Don't advertise an IPv6 exit policy, or accept IPv6 exit requests,
      if IPv6Exit is not true.
    • Nick Mathewson's avatar
    • Nick Mathewson's avatar
      Better policy support for IPv6 · a96c0aff
      Nick Mathewson authored
      Now, "accept *:80" means "accept all addresses on port 80", and not
      just IPv4.  For just v4, say "accept *4:80"; for just v6 say "accept
      We can parse these policies from torrc just fine, and we should be
      successfully keeping them out of descriptors for now.
      We also now include appropriate IPv6 addresses in "reject private:*"
    • Nick Mathewson's avatar
      Add a new family-specific syntax for tor_addr_parse_mask_ports · 2eb7eafc
      Nick Mathewson authored
      By default, "*" means "All IPv4 addresses" with
      tor_addr_parse_mask_ports, so I won't break anything.  But if the new
      EXTENDED_STAR flag is provided, then * means "any address", *4 means
      "any IPv4 address" (that is,, and "*6" means "any IPv6
      address" (that is, [::]/0).
      This is going to let us have a syntax for specifying exit policies in
      torrc that won't drive people mad.
      Also, add a bunch of unit tests for tor_addr_parse_mask_ports to test
      these new features, and to increase coverage.
  2. 23 Oct, 2012 3 commits
    • Roger Dingledine's avatar
      Let 0.2.3 clients exit to internal addresses if they want · 2ecee3fc
      Roger Dingledine authored
      Clients now consider the ClientRejectInternalAddresses config option
      when using a microdescriptor consensus stanza to decide whether
      an exit relay would allow exiting to an internal address. Fixes
      bug 7190; bugfix on
    • Roger Dingledine's avatar
      fix typo · e17fd577
      Roger Dingledine authored
    • Nick Mathewson's avatar
      Fix parse_short_policy (bug 7192.) · 85659d39
      Nick Mathewson authored
      Our implementation of parse_short_policy was screwed up: it would
      ignore the last character of every short policy.  Obviously, that's
      This patch fixes the busted behavior, and adds a bunch of unit tests
      to make sure the rest of that function is okay.
      Fixes bug 7192; fix on
  3. 22 Oct, 2012 2 commits
  4. 17 Oct, 2012 2 commits
  5. 27 Aug, 2012 1 commit
  6. 17 Jul, 2012 1 commit
    • Nick Mathewson's avatar
      Change all SMARTLIST_FOREACH loops of >=10 lines to use BEGIN/END · 7faf115d
      Nick Mathewson authored
      The SMARTLIST_FOREACH macro is more convenient than BEGIN/END when
      you have a nice short loop body, but using it for long bodies makes
      your preprocessor tell the compiler that all the code is on the same
      line.  That causes grief, since compiler warnings and debugger lines
      will all refer to that one line.
      So, here's a new style rule: SMARTLIST_FOREACH blocks need to be
  7. 28 Jun, 2012 1 commit
  8. 05 Jun, 2012 1 commit
  9. 04 Jun, 2012 1 commit
    • Nick Mathewson's avatar
      Add about 60 more DOCDOC comments to 0.2.3 · 173b18c7
      Nick Mathewson authored
      Also, try to resolve some doxygen issues.  First, define a magic
      "This is doxygen!" macro so that we take the correct branch in
      various #if/#else/#endifs in order to get the right documentation.
      Second, add in a few grouping @{ and @} entries in order to get some
      variables and fields to get grouped together.
  10. 29 Feb, 2012 1 commit
  11. 17 Feb, 2012 1 commit
  12. 18 Jan, 2012 1 commit
    • Nick Mathewson's avatar
      Rename nonconformant identifiers. · 26e789fb
      Nick Mathewson authored
      Fixes bug 4893.
      These changes are pure mechanical, and were generated with this
      perl script:
        /usr/bin/perl -w -i.bak -p
  13. 17 Jan, 2012 1 commit
  14. 16 Jan, 2012 2 commits
  15. 13 Jan, 2012 1 commit
  16. 15 Jul, 2011 3 commits
    • Nick Mathewson's avatar
      Remove compare_addr_to_node_policy · 6aef89bd
      Nick Mathewson authored
      Instead, use compare_tor_addr_to_node_policy everywhere.
      One advantage of this is that compare_tor_addr_to_node_policy can
      better distinguish from "unknown", which caused a nasty bug
      with microdesc users.
    • Nick Mathewson's avatar
      Treat null address as "unknown", not "rejected" in md policy · f40df02f
      Nick Mathewson authored
      Previously, we had an issue where we'd treat an unknown address as
      0, which turned into "", which looked like a rejected
      address.  This meant in practice that as soon as we started doing
      comparisons of unknown uint32 addresses to short policies, we'd get
      'rejected' right away.  Because of the circumstances under which
      this would be called, it would only happen when we had local DNS
      cached entries and we were looking to launch new circuits.
    • Nick Mathewson's avatar
      Remove compare_addr_to_addr_policy · 3380dc9c
      Nick Mathewson authored
      Nothing used it but the unit tests; everything else knows to use
      compare_tor_addr_to_addr_policy instead.
  17. 08 Jul, 2011 1 commit
  18. 01 Jul, 2011 1 commit
    • Nick Mathewson's avatar
      Don't shadow parameters with local variables · 1d18c2de
      Nick Mathewson authored
      This is a little error-prone when the local has a different type
      from the parameter, and is very error-prone with both have the same
      type.  Let's not do this.
      Fixes CID #437,438,439,440,441.
  19. 14 Jun, 2011 1 commit
    • Nick Mathewson's avatar
      Make the get_options() return const · 47c8433a
      Nick Mathewson authored
      This lets us make a lot of other stuff const, allows the compiler to
      generate (slightly) better code, and will make me get slightly fewer
      patches from folks who stick mutable stuff into or_options_t.
      const: because not every input is an output!
  20. 08 Jun, 2011 1 commit
  21. 06 Mar, 2011 1 commit
  22. 22 Feb, 2011 1 commit
  23. 20 Jan, 2011 1 commit
  24. 06 Jan, 2011 1 commit
    • Nick Mathewson's avatar
      Use autoconf's FLEXIBLE_ARRAY_MEMBER for unspecified-length arrays · d4165ef8
      Nick Mathewson authored
      C99 allows a syntax for structures whose last element is of
      unspecified length:
         struct s {
           int elt1;
           char last_element[];
      Recent (last-5-years) autoconf versions provide an
      to either no tokens (if you have c99 flexible array support) or to 1
      (if you don't).  At that point you just use offsetof
      [STRUCT_OFFSET() for us] to see where last_element begins, and
      allocate your structures like:
         struct s {
           int elt1;
           char last_element[FLEXIBLE_ARRAY_MEMBER];
         tor_malloc(STRUCT_OFFSET(struct s, last_element) +
      The advantages are:
         1) It's easier to see which structures and elements are of
            unspecified length.
         2) The compiler and related checking tools can also see which
            structures and elements are of unspecified length, in case they
            wants to try weird bounds-checking tricks or something.
         3) The compiler can warn us if we do something dumb, like try
            to stack-allocate a flexible-length structure.
  25. 03 Jan, 2011 1 commit
  26. 15 Oct, 2010 1 commit
  27. 14 Oct, 2010 2 commits
  28. 07 Oct, 2010 1 commit