Opened 13 years ago

Last modified 8 years ago

#612 closed defect (Duplicate)

tor needs to perform a dir request whenever starting as a server?

Reported by: mwenge Owned by:
Priority: Low Milestone: 0.2.0.x-final
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: mwenge, nickm, arma Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


[11:54] <mwenge> tor can no longer guess my ip address, so it never builds a desc_routerinfo - which causes all kinds of havoc
[11:56] <mwenge> i'm using trunk
[12:01] <mwenge> it's failing to guess mine completely: tries to figure it out from hostname, then finds the internal address, then says neither of those will do and gives up
[12:02] <mwenge> because it gets nothing from router_pick_published_address it doesn't get past go in router_rebuild_descriptor
[12:02] <mwenge> this results in it failing to assign desc_routerinfo
[12:02] <mwenge> so if i then do a getinfo dir/server/fp/ on my own server fingerprint - I get a segfault
[12:03] <mwenge> because desc_routerinfo doesn't exist and tor's assuming one exists
[12:03] <mwenge> this solves the segfault:
[12:04] <mwenge> but the real problem is failing to guess the ip
[12:05] <mwenge> it can only have been introduced recently because i generally use trunk
[12:10] <mwenge> the real problem is probably in router_guess_address_from_dir_headers somewhere
[12:16] <karsten> mwenge: sry, looking at the commit statements did not reveal (to me) which one changed that behavior.
[12:17] <mwenge> karsten: same here. i think i see the problem. if tor starts and has relatively fresh server info cached it doesn't get an ip from the dir servers until the next time it requests something
[12:17] <mwenge> so last_guessed_ip remains 0. and if you run a server your address remains undetermined
[12:20] <mwenge> so it looks as if tor needs to perform a dir request when starting at all times
[12:20] <mwenge> or else cache x-your-address on file - which seems a bad idea
[12:22] <mwenge> yup. rm -rf cache- and restarting tor gets last_guessed_ip populated again
[12:22] <mwenge> just restarting tor with clearing the cache results it in remaining 0

sorry for the straight paste - i'm lazy

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (5)

comment:1 Changed 13 years ago by nickm

Is this a duplicate of 609?

comment:2 Changed 13 years ago by arma

Not quite a duplicate. If we start with new enough dir info that we don't need
to fetch any new dir info (say, because we just restarted), yet we're relying
on the dir fetches to tell us our IP address, we'll sit around idle for a few
hours until it's time to fetch fresh dir info.

I guess one fix is to notice that all our dir info is fresh enough on startup
that we won't be launching any dir conns anytime soon, and in that case plus the
case where we don't know our IP address, we should launch a trivial fetch. I
wonder if there's a fix that doesn't involve so much of what feels like special
case code.

comment:3 Changed 13 years ago by arma

Solving 652 will solve this one. So I'm going to close this as a duplicate.

comment:4 Changed 13 years ago by arma

flyspray2trac: bug closed.

comment:5 Changed 8 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.