sub check_ntp
{
-return $_[0] =~ /^(\S+):(\d+)$/ && gethostbyname($1) ? undef
+return $_[0] =~ /^(\S+):(\d+)$/ && &to_ipaddress("$1") ? undef
: $text{'acl_entp'};
}
sub valid_srcdest
{
-return gethostbyname($_[0]) ||
+return &to_ipaddress($_[0]) ||
($_[0] =~ /^([0-9\.]+)\/(\d+)$/ &&
&check_ipaddress($1) && $2 > 0 && $2 <= 32) ||
($_[0] =~ /^([0-9\.]+)\/([0-9\.]+)$/ &&
sub check_proxy
{
-return $_[0] =~ /^(\S+):(\d+)$/ && gethostbyname($1) ?
+return $_[0] =~ /^(\S+):(\d+)$/ && &to_ipaddress($1) ?
undef : $text{'cache_eproxy'};
}
# Validate inputs
if ($in{'enabled'} == 1) {
- gethostbyname($in{'net'}) ||
+ &to_ipaddress($in{'net'}) ||
($in{'net'} =~ /^([0-9\.]+)\/(\d+)$/ &&
&check_ipaddress($1) && $2 > 0 && $2 <= 32) ||
&error($text{'iptables_enet'});
sub check_listen
{
-return gethostbyname($_[0]) ? undef : $text{'net_ehost'};
+return &to_ipaddress($_[0]) ? undef : $text{'net_ehost'};
}
sub check_port
sub check_proxy
{
-return $_[0] =~ /^(\S+):(\d+)$/ && gethostbyname($1) ? undef : $text{'net_eproxy'};
+return $_[0] =~ /^(\S+):(\d+)$/ && &to_ipaddress($1) ?
+ undef : $text{'net_eproxy'};
}
sub check_ip