[tor-bugs] #5053 [Tor Bridge]: Fix IPv6 implementation for bridge statistics

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Mon Feb 13 06:46:23 UTC 2012


#5053: Fix IPv6 implementation for bridge statistics
------------------------+---------------------------------------------------
 Reporter:  karsten     |          Owner:                    
     Type:  defect      |         Status:  needs_revision    
 Priority:  major       |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Bridge  |        Version:                    
 Keywords:              |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------

Comment(by karsten):

 Replying to [comment:11 nickm]:
 > Replying to [comment:10 arma]:
 > > Replying to [comment:9 nickm]:
 > > > I think that the return value for geop_get_country_by_addr() is
 wrong: -1 means "we have no geoip file loaded", not "country unknown."
 The unknown country is 0, right?
 > >
 > > Well, we don't have any geoip information about ipv6 addresses loaded.
 So I think it could count as ambiguous.
 >
 > If we want to count ipv6 as "??", then the answer must be "unknown
 country".  If we return -1, then we won't count it.

 I was wondering about -1 vs. 0, too.  I picked -1 here because "we have no
 geoip file loaded" is the correct answer and because all places calling
 geoip_get_country_by_ip() check for country_idx < 0 and set it to 0 if
 they want to treat both cases as "country unknown".  Now, I'm not sure if
 that's the cleanest approach, but I didn't want to touch it.

 Linus and I are going to test this patch today.  We're going to check
 whether IPv6 addresses are counted as "??" with the -1 result.

 But if you like 0 better, I don't mind at all changing that.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/5053#comment:12>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list