[tor-bugs] #7193 [Core Tor/Tor]: Tor's sybil protection doesn't consider IPv6

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Mar 10 14:45:23 UTC 2020


#7193: Tor's sybil protection doesn't consider IPv6
-------------------------------------------------+-------------------------
 Reporter:  asn                                  |          Owner:  (none)
     Type:  enhancement                          |         Status:  new
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  unspecified
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  ipv6, intro, tor-dirauth, security,  |  Actual Points:
  sybil, network-health, outreachy-ipv6          |
Parent ID:  #24403                               |         Points:  1
 Reviewer:                                       |        Sponsor:
                                                 |  Sponsor55-can
-------------------------------------------------+-------------------------

Comment (by nickm):

 You need to read the warnings carefully:
 {{{
 In file included from ./src/lib/container/map.h:15,
                  from ./src/core/or/or.h:27,
                  from src/feature/client/bridges.c:16:
 ./src/feature/nodelist/dirlist.h:30:16: error: redundant redeclaration of
 ‘router_digest_is_trusted_dir_type’ [-Werror=redundant-decls]
    30 | MOCK_DECL(int, router_digest_is_trusted_dir_type,
       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ./src/lib/testsupport/testsupport.h:128:6: note: in definition of macro
 ‘MOCK_DECL’
   128 |   rv funcname arglist
       |      ^~~~~~~~
 In file included from src/feature/client/bridges.c:28:
 ./src/feature/nodelist/dirlist.h:28:5: note: previous declaration of
 ‘router_digest_is_trusted_dir_type’ was here
    28 | int router_digest_is_trusted_dir_type(const char *digest,
       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 }}}

 This is telling you that the function `router_digest_is_trusted_dir_type`
 is getting declared twice: first on line 28, and then on line 30.

 If you remove the declaration on line 28, that warning will go away.

 There's still another warning in dirlist.c, since you're using MOCK_DECL
 there: when you are implementing a function, you use MOCK_IMPL instead.
 There should only be one implementation of the function in dirlist.c, and
 it should be decorated with MOCK_IMPL.

 When you actually want to declare a mock replacement for the function, you
 do that in the unit tests, and you give it a different name from the
 original function.  Then in the test code, you can use MOCK and UNMOCK to
 replace the original function.

 There's more documentation on mocking, along with examples, in
 `src/lib/testsupport/testsupport.h`,
 and in `doc/HACKING/WritingTests.md`



  -- the mock implementation doesn't belon

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/7193#comment:23>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list