chiark / gitweb /
Changes to make it appear to work on chiark
[userv-utils.git] / dyndns / service
index 37bf62374d82920c5225e41c03bafb10f6da62d9..92caf4975e0913939623c371e1c64a280831eb14 100755 (executable)
@@ -7,12 +7,32 @@
 #    to <subdomain>.<zone>, and so must not have a trailing `.';
 #    where the owner is to be <subdomain>.<zone>, `@' must be used.
 
+# Copyright (C) 1999-2000,2003 Ian Jackson
+#
+# This file is part dyndns, part of userv-utils
+#
+# This is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with userv-utils; if not, write to the Free Software
+# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
 use POSIX;
 
 BEGIN {
     $vardir= "/var/lib/userv/dyndns";
     $defconf= "/etc/userv/dyndns-domains";
-    $libdir= "/usr/local/lib/userv/dyndns";
+    $libdir= "/usr/share/userv/dyndns";
 }
 END {
     remove "$vardir/tmp/$$" or $! == ENOENT or
@@ -22,6 +42,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 +142,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') {