1. 06 May, 2020 1 commit
    • Nick Mathewson's avatar
      Use __attribute__((fallthrough)) rather than magic GCC comments. · cc397449
      Nick Mathewson authored
      GCC added an implicit-fallthrough warning a while back, where it
      would complain if you had a nontrivial "case:" block that didn't end
      with break, return, or something like that.  Clang recently added
      the same thing.
      
      GCC, however, would let you annotate a fall-through as intended by
      any of various magic "/* fall through */" comments.  Clang, however,
      only seems to like "__attribute__((fallthrough))".  Fortunately, GCC
      accepts that too.
      
      A previous commit in this branch defined a FALLTHROUGH macro to do
      the right thing if GNUC is defined; here we replace all of our "fall
      through" comments with uses of that macro.
      
      This is an automated commit, made with the following perl one-liner:
      
        #!/usr/bin/perl -i -p
        s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
      cc397449
  2. 10 Sep, 2019 1 commit
    • Nick Mathewson's avatar
      pf: when extracting an IPv6 address, make sure we got an IPv6 address · 97f7efa9
      Nick Mathewson authored
      Our code assumes that when we're configured to get IPv6 addresses
      out of a TRANS_PF transparent proxy connection, we actually will.
      But we didn't check that, and so FreeBSD started warning us about a
      potential NULL pointer dereference.
      
      Fixes part of bug 31687; bugfix on 0.2.3.4-alpha when this code was
      added.
      97f7efa9
  3. 16 Jan, 2019 1 commit
  4. 09 Jan, 2019 1 commit
    • Kris Katterjohn's avatar
      Fix (and make consistent) the use of OpenBSD preprocessor macro tests · c13a81f7
      Kris Katterjohn authored and Nick Mathewson's avatar Nick Mathewson committed
      Prior to this commit, the testsuite was failing on OpenBSD.  After
      this commit the testsuite runs fine on OpenBSD.
      
      It was previously decided to test for the OpenBSD macro (rather than
      __OpenBSD__, etc.) because OpenBSD forks seem to have the former
      macro defined.  sys/param.h must be included for the OpenBSD macro
      definition; however, many files tested for the OpenBSD macro without
      having this header included.
      
      This commit includes sys/param.h in the files where the OpenBSD macro
      is used (and sys/param.h is not already included), and it also
      changes some instances of the __OpenBSD__ macro to OpenBSD.
      
      See commit 27df23ab
      
       which changed
      everything to use OpenBSD instead of __OpenBSD__ or OPENBSD.  See
      also tickets #6982 and #20980 (the latter ticket is where it was
      decided to use the OpenBSD macro).
      
      Signed-off-by: default avatarKris Katterjohn <katterjohn@gmail.com>
      c13a81f7
  5. 04 Dec, 2018 1 commit
    • David Goulet's avatar
      conn: Add an helper to mark a connection as waiting for an HS descriptor · d0682fe0
      David Goulet authored
      
      
      The transition for a connection to either become or go back in
      AP_CONN_STATE_RENDDESC_WAIT state must make sure that the entry connection is
      _not_ in the waiting for circuit list.
      
      This commit implements the helper function
      connection_ap_mark_as_waiting_for_renddesc() that removes the entry connection
      from the pending list and then change its state. This code pattern is used in
      many places in the code where next commit will remove this code duplication to
      use this new helper function.
      
      Part of #28669
      
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
      d0682fe0
  6. 14 Oct, 2018 1 commit
  7. 27 Sep, 2018 1 commit
    • Nick Mathewson's avatar
      Move the predicted ports code out of rephist.c · 241c1505
      Nick Mathewson authored
      It differs from the rest of the rephist code in that it's actually
      necessary for Tor to operate, so it should probably go somewhere
      else.  I'm not sure where yet, so I'll leave it in the same
      directory, but give it its own file.
      241c1505
  8. 25 Sep, 2018 2 commits
  9. 21 Sep, 2018 2 commits
    • Nick Mathewson's avatar
      Split directory.c code into several modules · 194acfb5
      Nick Mathewson authored
      Parts of this C file naturally belong in dircache, dirclient, and
      dircommon: so, move them there.
      194acfb5
    • Nick Mathewson's avatar
      Split main.c into main.c and mainloop.c · c7ce6b98
      Nick Mathewson authored
      The main.c code is responsible for initialization and shutdown;
      the mainloop.c code is responsible for running the main loop of Tor.
      
      Splitting the "generic event loop" part of mainloop.c from the
      event-loop-specific part is not done as part of this patch.
      c7ce6b98
  10. 15 Sep, 2018 6 commits
  11. 12 Sep, 2018 1 commit
  12. 28 Aug, 2018 1 commit
  13. 10 Jul, 2018 1 commit
  14. 05 Jul, 2018 3 commits
    • Nick Mathewson's avatar
      Fix every include path changed in the previous commit (automated) · ef486e3c
      Nick Mathewson authored
      I am very glad to have written this script.
      ef486e3c
    • Nick Mathewson's avatar
      Move literally everything out of src/or · 63b4ea22
      Nick Mathewson authored
      This commit won't build yet -- it just puts everything in a slightly
      more logical place.
      
      The reasoning here is that "src/core" will hold the stuff that every (or
      nearly every) tor instance will need in order to do onion routing.
      Other features (including some necessary ones) will live in
      "src/feature".  The "src/app" directory will hold the stuff needed
      to have Tor be an application you can actually run.
      
      This commit DOES NOT refactor the former contents of src/or into a
      logical set of acyclic libraries, or change any code at all.  That
      will have to come in the future.
      
      We will continue to move things around and split them in the future,
      but I hope this lays a reasonable groundwork for doing so.
      63b4ea22
    • Nick Mathewson's avatar
      2d69c32b
  15. 03 Jul, 2018 1 commit
  16. 01 Jul, 2018 1 commit
  17. 28 Jun, 2018 1 commit
  18. 21 Jun, 2018 2 commits
  19. 20 Jun, 2018 2 commits
  20. 15 Jun, 2018 8 commits
  21. 09 May, 2018 2 commits