Also catch 0/8 in exit_policy_implicitly_allows_local_networks()

svn:r5885
This commit is contained in:
Peter Palfrader 2006-02-01 02:31:27 +00:00
parent 686508a04a
commit 61ea27620a

View File

@ -2528,6 +2528,7 @@ exit_policy_implicitly_allows_local_networks(addr_policy_t *policy,
static struct { static struct {
uint32_t addr; uint32_t mask; const char *network; uint32_t addr; uint32_t mask; const char *network;
} private_networks[] = { } private_networks[] = {
{ 0x00000000, 0xff000000, "\"this\" network (0.0.0.0/8)" },
{ 0x7f000000, 0xff000000, "localhost (127.0.0.0/8)" }, { 0x7f000000, 0xff000000, "localhost (127.0.0.0/8)" },
{ 0x0a000000, 0xff000000, "addresses in private network 10.0.0.0/8" }, { 0x0a000000, 0xff000000, "addresses in private network 10.0.0.0/8" },
{ 0xa9fe0000, 0xffff0000, "addresses in private network 169.254.0.0/16" }, { 0xa9fe0000, 0xffff0000, "addresses in private network 169.254.0.0/16" },
@ -2535,7 +2536,7 @@ exit_policy_implicitly_allows_local_networks(addr_policy_t *policy,
{ 0xc0a80000, 0xffff0000, "addresses in private network 192.168.0.0/16" }, { 0xc0a80000, 0xffff0000, "addresses in private network 192.168.0.0/16" },
{ 0,0,NULL}, { 0,0,NULL},
}; };
for (i=0; private_networks[i].addr; ++i) { for (i=0; private_networks[i].mask; ++i) {
p = NULL; p = NULL;
/* log_fn(LOG_INFO,"Checking network %s", private_networks[i].network); */ /* log_fn(LOG_INFO,"Checking network %s", private_networks[i].network); */
if (policy_includes_addr_mask_implicitly( if (policy_includes_addr_mask_implicitly(