chiark / gitweb /
IPv6 support - minor change courtesy of Ben Harris
authorian <ian>
Sun, 15 Jun 2003 17:34:23 +0000 (17:34 +0000)
committerian <ian>
Sun, 15 Jun 2003 17:34:23 +0000 (17:34 +0000)
dyndns/service

index 37bf62374d82920c5225e41c03bafb10f6da62d9..65b58efe22bab09381af03504caa0c11fd7d59e1 100755 (executable)
@@ -22,6 +22,7 @@ END {
 use FileHandle;
 use IO::File;
 use Socket;
+use Socket6;
 
 @ARGV==2 or die "need <zone> and <domain> arguments\n";
 ($zone,$subdomain) = @ARGV;
@@ -121,6 +122,10 @@ for (;;) {
        defined($addr= inet_aton $_) or
            die "input:$.:$owner:invalid IP address\n";
        $data= inet_ntoa($addr);
+    } elsif ($type eq 'AAAA') {
+       defined($addr= inet_pton(AF_INET6, $_)) or
+           die "input:$.:$owner:invalid IPv6 address\n";
+       $data = inet_ntop(AF_INET6, $addr);
     } elsif ($type eq 'CNAME') {
        $data= domainsyntax_rel("input:$.:$owner:canonical name",$_).".";
     } elsif ($type eq 'MX') {