From 1a72f31cc83af2d565fdd0d6b6a7f73b79dbcad5 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 23 Jun 2009 21:41:22 +0000 Subject: [PATCH] FSCORE-385 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13925 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/switch_core.c b/src/switch_core.c index 6fdb798265..7ba64ec773 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -871,7 +871,6 @@ SWITCH_DECLARE(void) switch_load_network_lists(switch_bool_t reload) int mask = 0; char guess_mask[16] = ""; char *tmp_name; - int ip_tmp = 0; struct in_addr in; switch_find_local_ip(guess_ip, sizeof(guess_ip), &mask, AF_INET); @@ -912,6 +911,10 @@ SWITCH_DECLARE(void) switch_load_network_lists(switch_bool_t reload) tmp_name = "nat.auto"; switch_network_list_create(&rfc_list, tmp_name, SWITCH_FALSE, IP_LIST.pool); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Created ip list %s default (deny)\n", tmp_name); + if (switch_network_list_add_host_mask(rfc_list, guess_ip, guess_mask, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, + "Adding %s/%s (deny) to list %s\n", guess_ip, guess_mask, tmp_name); + } switch_network_list_add_cidr(rfc_list, "10.0.0.0/8", SWITCH_TRUE); switch_network_list_add_cidr(rfc_list, "172.16.0.0/12", SWITCH_TRUE); switch_network_list_add_cidr(rfc_list, "192.168.0.0/16", SWITCH_TRUE); @@ -933,16 +936,6 @@ SWITCH_DECLARE(void) switch_load_network_lists(switch_bool_t reload) } switch_core_hash_insert(IP_LIST.hash, tmp_name, list); - switch_inet_pton(AF_INET, guess_ip, &ip_tmp); - ip_tmp = htonl(ip_tmp); - tmp_name = "nat.auto"; - - if (switch_network_list_validate_ip_token(rfc_list, ip_tmp, NULL)) { - switch_network_list_add_host_mask(rfc_list, guess_ip, guess_mask, SWITCH_FALSE); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, - "Adding %s/%s (deny) to list %s\n", guess_ip, guess_mask, tmp_name); - } - if ((xml = switch_xml_open_cfg("acl.conf", &cfg, NULL))) { if ((x_lists = switch_xml_child(cfg, "network-lists"))) {