mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-19 07:23:03 +02:00
tor.cgi: look up Tor relay country codes using libloc
Tor provides a function to resolve a relay's IP address into a country code by taking advantage of a (heavily outdated) GeoIP database shipped with it. We should consequently use libloc for doing this, since it can be confusing if those results differ from active connections in the connection tracking CGI (where we _use_ libloc) and such tasks are why we invented libloc in the first place. :-) Signed-off-by: Peter Müller <peter.mueller@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
f717db9172
commit
c63ea6cf49
@@ -912,7 +912,7 @@ sub TorNodeDescription() {
|
||||
$node->{'address'} = $3;
|
||||
$node->{'port'} = $4;
|
||||
|
||||
my $country_code = &TorGetInfo($tor, "ip-to-country/$node->{'address'}");
|
||||
my $country_code = &Location::Functions::lookup_country_code($db_handle, $node->{'address'});
|
||||
$node->{'country_code'} = $country_code;
|
||||
|
||||
# Flags
|
||||
|
||||
Reference in New Issue
Block a user