Skip to content
GitLab
  • Menu
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 316
    • Issues 316
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 36
    • Merge requests 36
  • 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
  • #5298
Closed
Open
Created Mar 02, 2012 by Trac@tracbot

Relay does not pick the right IP addr of local node when multiple interfaces are available

My laptop has two network interfaces: eth0, statically configured, in use when I'm wired in my office; and ppp0, dynamically configured, when I'm abroad and use a 3G wireless interface.

When I'm on eth0 (LAN), the tor relay works regularly. When I'm on the ppp0 (3G wireless), the tor relay works too but the ORPort and DirPort are not reachable from the outside, because the relay still picks the IP address associated to eth0 instead of ppp0.

This problem affects both on the stable release (0.2.2.35) and the latest git snapshot (and probably many other releases).

With the stable release, I've tracked the bug down to src/or/config.c:resolve_my_address(), a rather messy piece of code which mistakenly resolves via hostname rather than picking the IP address based on the actual route default. I had to rewrite that function almost from scratch, and now it works.

With the latest snapshot, same problem in src/or/config.c:resolve_my_address(), plus another issue in src/common/address.c:get_interface_address6(): here a list of all net devices available is built, but then the first valid one is picked, regardless of it being the one in use or not (on my laptop it always chooses eth0). Solved by disabling the list of net devices, thus falling back to the default "discovery" mechanism (the only one implemented in the stable release).

I have patches, if needed.

Trac:
Username: ciaccio

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