X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=dyndns%2Fservice;h=92caf4975e0913939623c371e1c64a280831eb14;hb=92fc834ef77fe48782f2fb1b0f5c52a22127374c;hp=37bf62374d82920c5225e41c03bafb10f6da62d9;hpb=3988a733004005983b60aba74306368c122180f2;p=userv-utils.git diff --git a/dyndns/service b/dyndns/service index 37bf623..92caf49 100755 --- a/dyndns/service +++ b/dyndns/service @@ -7,12 +7,32 @@ # to ., and so must not have a trailing `.'; # where the owner is to be ., `@' 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 and 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') {