More IPv6 function conversions
authorJamie Cameron <jcameron@webmin.com>
Sun, 7 Nov 2010 06:32:08 +0000 (23:32 -0700)
committerJamie Cameron <jcameron@webmin.com>
Sun, 7 Nov 2010 06:32:08 +0000 (23:32 -0700)
ipfw/save_rule.cgi
ipsec/save.cgi
ldap-client/save_server.cgi
pap/save_secret.cgi
postfix/save_master.cgi

index e022529..0eb9db2 100755 (executable)
@@ -158,12 +158,11 @@ else {
                        $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};
index bcc9b68..35ae538 100755 (executable)
@@ -119,7 +119,7 @@ else {
                        $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};
                        }
 
index 7c0b355..2ed87ca 100755 (executable)
@@ -31,7 +31,8 @@ else {
        # 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));
index 4635c57..0050ef1 100755 (executable)
@@ -35,7 +35,7 @@ elsif ($in{'ips_mode'} == 1) { $sec{'ips'} = [ "-" ]; }
 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));
                        }
                }
index d151ca6..1528e14 100755 (executable)
@@ -25,7 +25,7 @@ else {
        $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'};
                }