From c01237c6bc5ec25063b4aae1799fe4de01a7455b Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Tue, 27 Nov 2001 20:59:52 +0000 Subject: [PATCH] 1140. [bug] rndc-confgen did not accept IPv6 addresses as arguments to the -s option. [RT #2138] --- CHANGES | 3 +++ bin/rndc/rndc-confgen.c | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 210eec078e..93515e2bd9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1140. [bug] rndc-confgen did not accept IPv6 addresses as arguments + to the -s option. [RT #2138] + 1139. [func] It is now possible to flush a given name from the cache(s) via 'rndc flushname name [view]'. [RT #2051] diff --git a/bin/rndc/rndc-confgen.c b/bin/rndc/rndc-confgen.c index 25dc20c6ce..00427fce7e 100644 --- a/bin/rndc/rndc-confgen.c +++ b/bin/rndc/rndc-confgen.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rndc-confgen.c,v 1.11 2001/09/06 23:14:37 gson Exp $ */ +/* $Id: rndc-confgen.c,v 1.12 2001/11/27 20:59:52 gson Exp $ */ #include @@ -139,7 +139,8 @@ main(int argc, char **argv) { int keysize; int entropy_flags = 0; int open_keyboard = ISC_ENTROPY_KEYBOARDMAYBE; - struct in_addr addr; + struct in_addr addr4_dummy; + struct in6_addr addr6_dummy; char *chrootdir = NULL; char *user = NULL; isc_boolean_t keyonly = ISC_FALSE; @@ -197,9 +198,9 @@ main(int argc, char **argv) { break; case 's': serveraddr = isc_commandline_argument; - if (inet_aton(serveraddr, &addr) == 0) + if (inet_pton(AF_INET, serveraddr, &addr4_dummy) != 1 && + inet_pton(AF_INET6, serveraddr, &addr6_dummy) != 1) fatal("-s should be an IPv4 or IPv6 address"); - break; case 't': chrootdir = isc_commandline_argument;