Merge branch 'maint-0.2.3' into release-0.2.3

This commit is contained in:
Roger Dingledine 2013-04-19 11:11:24 -04:00
commit d19db9305b
9 changed files with 78373 additions and 9783 deletions

4
changes/bug8208 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes:
- Avoid a crash if we fail to generate an extrinfo descriptor.
Fixes bug 8208; bugfix on 0.2.3.16-alpha. Found by Coverity;
this is CID 718634.

3
changes/bug8377 Normal file
View File

@ -0,0 +1,3 @@
o Minor bugfixes:
- Correctly recognize that [::1] is a loopback address. Fixes bug #8377;
bugfix on 0.2.1.3-alpha.

3
changes/geoip-apr2013 Normal file
View File

@ -0,0 +1,3 @@
o Minor features:
- Update to the April 3 2013 Maxmind GeoLite Country database.

3
changes/geoip-feb2013 Normal file
View File

@ -0,0 +1,3 @@
o Minor features:
- Update to the February 6 2013 Maxmind GeoLite Country database.

3
changes/geoip-mar2013 Normal file
View File

@ -0,0 +1,3 @@
o Minor features:
- Update to the March 6 2013 Maxmind GeoLite Country database.

View File

@ -779,7 +779,8 @@ tor_addr_is_loopback(const tor_addr_t *addr)
case AF_INET6: {
/* ::1 */
uint32_t *a32 = tor_addr_to_in6_addr32(addr);
return (a32[0] == 0) && (a32[1] == 0) && (a32[2] == 0) && (a32[3] == 1);
return (a32[0] == 0) && (a32[1] == 0) && (a32[2] == 0) &&
(ntohl(a32[3]) == 1);
}
case AF_INET:
/* 127.0.0.1 */

File diff suppressed because it is too large Load Diff

View File

@ -1702,9 +1702,13 @@ router_rebuild_descriptor(int force)
anyway, since they don't have a DirPort, and always connect to the
bridge authority anonymously. But just in case they somehow think of
sending them on an unencrypted connection, don't allow them to try. */
ri->cache_info.send_unencrypted = ei->cache_info.send_unencrypted = 0;
ri->cache_info.send_unencrypted = 0;
if (ei)
ei->cache_info.send_unencrypted = 0;
} else {
ri->cache_info.send_unencrypted = ei->cache_info.send_unencrypted = 1;
ri->cache_info.send_unencrypted = 1;
if (ei)
ei->cache_info.send_unencrypted = 1;
}
router_get_router_hash(ri->cache_info.signed_descriptor_body,

View File

@ -623,12 +623,48 @@ test_addr_ip6_helpers(void)
;
}
static void
test_addr_is_loopback(void *data)
{
static const struct loopback_item {
const char *name;
int is_loopback;
} loopback_items[] = {
{ "::1", 1 },
{ "127.0.0.1", 1 },
{ "127.99.100.101", 1 },
{ "128.99.100.101", 0 },
{ "8.8.8.8", 0 },
{ "0.0.0.0", 0 },
{ "::2", 0 },
{ "::", 0 },
{ "::1.0.0.0", 0 },
{ NULL, 0 }
};
int i;
tor_addr_t addr;
(void)data;
for (i=0; loopback_items[i].name; ++i) {
tt_int_op(tor_addr_parse(&addr, loopback_items[i].name), >=, 0);
tt_int_op(tor_addr_is_loopback(&addr), ==, loopback_items[i].is_loopback);
}
tor_addr_make_unspec(&addr);
tt_int_op(tor_addr_is_loopback(&addr), ==, 0);
done:
;
}
#define ADDR_LEGACY(name) \
{ #name, legacy_test_helper, 0, &legacy_setup, test_addr_ ## name }
struct testcase_t addr_tests[] = {
ADDR_LEGACY(basic),
ADDR_LEGACY(ip6_helpers),
{ "is_loopback", test_addr_is_loopback, 0, NULL, NULL },
END_OF_TESTCASES
};