Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#1883 closed enhancement (implemented)

Include GeoIP database identifier in extra-info descriptors

Reported by: karsten Owned by:
Priority: Medium Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

With the recent change from ip-to-country to free Maxmind, relays can report very different country statistics in their extra-info descriptors. While it's possible to guess which GeoIP database was used from the running Tor version, operators can manually override the default GeoIP database and use their own database. Relays should include a unique identifier of the used database, which can be the shasum of the geoip file.

Child Tickets

Change History (7)

comment:1 Changed 9 years ago by karsten

Status: newneeds_review

See enhancement1883 in my public repository.

comment:2 Changed 9 years ago by nickm

Milestone: Tor: post 0.2.2.xTor: 0.2.3.x-final

comment:3 Changed 9 years ago by nickm

looks okay. A couple of issues:

In geoip_db_digest(), the documentation for the function should explain that calling hex_str() invalidates its return value.

In extrainfo_dump_to_string:

+ s[pos] = '\0';
This should be unneeded, since tor_snprintf always nul-terminates.
+ write_stats_to_extrainfo = 0;
Why? The right response on tor_snprintf() failing here is probably just to call the whole extrainfo a failure.

Other than that looks fine.

comment:4 in reply to:  3 Changed 9 years ago by karsten

Replying to nickm:

looks okay. A couple of issues:

In geoip_db_digest(), the documentation for the function should explain that calling hex_str() invalidates its return value.

Added a sentence to the documentation.

In extrainfo_dump_to_string:

+ s[pos] = '\0';
This should be unneeded, since tor_snprintf always nul-terminates.
+ write_stats_to_extrainfo = 0;
Why? The right response on tor_snprintf() failing here is probably just to call the whole extrainfo a failure.

Okay. I took this code out of the if block. If writing the geoip-db-digest line fails, writing the extra-info descriptor fails, too.

Other than that looks fine.

Great! Thanks for the feedback. Please find the updated branch enhancement1883 in my public repository.

comment:5 Changed 9 years ago by nickm

Resolution: implemented
Status: needs_reviewclosed

merged & closing. Thanks!

comment:6 Changed 7 years ago by nickm

Keywords: tor-relay added

comment:7 Changed 7 years ago by nickm

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