fix MODAPP-113

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9016 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-07-14 16:32:56 +00:00
parent d6022f302a
commit b46693e3ca
2 changed files with 6 additions and 1 deletions

View File

@ -700,6 +700,8 @@ SWITCH_DECLARE(switch_bool_t) switch_check_network_list_ip(const char *ip_str, c
switch_mutex_lock(runtime.global_mutex); switch_mutex_lock(runtime.global_mutex);
switch_inet_pton(AF_INET, ip_str, &ip); switch_inet_pton(AF_INET, ip_str, &ip);
ip = htonl(ip);
if ((list = switch_core_hash_find(IP_LIST.hash, list_name))) { if ((list = switch_core_hash_find(IP_LIST.hash, list_name))) {
ok = switch_network_list_validate_ip(list, ip); ok = switch_network_list_validate_ip(list, ip);
} else if (strchr(list_name, '/')) { } else if (strchr(list_name, '/')) {

View File

@ -169,7 +169,10 @@ SWITCH_DECLARE(int) switch_parse_cidr(const char *string, uint32_t *ip, uint32_t
bits = atoi(bit_str); bits = atoi(bit_str);
switch_inet_pton(AF_INET, host, ip); switch_inet_pton(AF_INET, host, ip);
*mask = 0xFFFFFFFF & ~(0xFFFFFFFF << bits); *ip = htonl(*ip);
*mask = 0xFFFFFFFF & ~(0xFFFFFFFF >> bits);
*bitp = bits; *bitp = bits;
return 0; return 0;