Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #18529
Closed (moved) (moved)
Open
Created Mar 11, 2016 by Nick Mathewson@nickm👁

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 #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