$rule->{$s} = "me";
}
else {
- gethostbyname($in{$s}) ||
- &check_ipaddress($in{$s}) ||
+ &to_ipaddress($in{$s}) ||
($in{$s} =~ /^([0-9\.]+)\/(\d+)$/ &&
- &check_ipaddress($1)) ||
+ &check_ipaddress("$1")) ||
($in{$s} =~ /^([0-9\.]+)\/(\d+)\{([0-9,]+)\}$/ &&
- &check_ipaddress($1) &&
+ &check_ipaddress("$1") &&
$ipfw_version >= 2) ||
&error($text{'save_e'.$s});
$rule->{$s} = $in{$s};
$conn->{'values'}->{$d} = '%opportunistic';
}
else {
- gethostbyname($in{$d}) || &error($text{"save_e${d}"});
+ &to_ipaddress($in{$d}) || &error($text{"save_e${d}"});
$conn->{'values'}->{$d} = $in{$d};
}
# Set host and port directives
@hosts = split(/\s+/, $in{'host'});
foreach $h (@hosts) {
- gethostbyname($h) || &error(&text('server_ehost', $h));
+ &to_ipaddress($h) || &to_ip6address($h) ||
+ &error(&text('server_ehost', $h));
}
@hosts || &error($text{'server_ehosts'});
&save_directive($conf, "host", join(" ", @hosts));
elsif ($in{'ips_mode'} == 2) {
@ips = split(/\s+/, $in{'ips'});
foreach $ip (@ips) {
- if (!gethostbyname($ip)) {
+ if (!&to_ipaddress($ip)) {
&error(&text('save_secret_enoip', $ip));
}
}
$prog->{'enabled'} = $in{'enabled'};
$in{'name'} =~ /^\S+$/ || &error($text{'master_ename'});
if (!$in{'host_def'}) {
- gethostbyname($in{'host'}) || &error($text{'master_ehost'});
+ &to_ipaddress($in{'host'}) || &error($text{'master_ehost'});
$in{'type'} eq 'inet' || &error($text{'master_einet'});
$prog->{'name'} = $in{'host'}.":".$in{'name'};
}