Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 329
    • Issues 329
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #18529
Closed
Open
Issue created Mar 11, 2016 by Nick Mathewson@nickm🌻Owner

Fix duplicate check for "only allow internal addresses if we are on a network with nonstandard authorities"

We have this code in config.c:

  if (tor_addr_is_internal(&myaddr, 0)) {
    /* make sure we're ok with publishing an internal IP */
    if (!options->DirAuthorities && !options->AlternateDirAuthority) {
      /* if they are using the default authorities, disallow internal IPs
       * always. */
      log_fn(warn_severity, LD_CONFIG,
             "Address '%s' resolves to private IP address '%s'. "
             "Tor servers that use the default DirAuthorities must have "
             "public IP addresses.", hostname, addr_string);
      tor_free(addr_string);
      return -1;
    }
...

And we now have this code in router.c (since legacy/trac#17153 (moved)):

        /* Like IPv4, if the relay is configured using the default
         * authorities, disallow internal IPs. Otherwise, allow them. */
        const int default_auth = (!options->DirAuthorities &&
                                  !options->AlternateDirAuthority);
        if (! tor_addr_is_internal(&p->addr, 0) || ! default_auth) {
          ipv6_orport = p;
          break;
...

These two checks are similar and I'd prefer that they be merged when possible.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking