From: Andreas Gustafsson Date: Tue, 17 Oct 2000 20:09:19 +0000 (+0000) Subject: revision 1.30 broke the default lwres address of 127.0.0.1 X-Git-Tag: v9.0.1^4~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b34d8267e8228b4615b9eae4e32d9ad1f308179;p=thirdparty%2Fbind9.git revision 1.30 broke the default lwres address of 127.0.0.1 by incorrectly assuming that lwres_addr_parse() parses an address in string form (it actually parses an address in lwres wire form) --- diff --git a/lib/lwres/context.c b/lib/lwres/context.c index b567be6dc54..af9e5f89eb6 100644 --- a/lib/lwres/context.c +++ b/lib/lwres/context.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: context.c,v 1.31 2000/10/12 21:39:23 bwelling Exp $ */ +/* $Id: context.c,v 1.32 2000/10/17 20:09:19 gson Exp $ */ #include @@ -189,11 +189,14 @@ context_connect(lwres_context_t *ctx) { sizeof(lwres_addr_t)); LWRES_LINK_INIT(&ctx->address, link); } else { - char localhost[] = "127.0.0.1"; - lwres_buffer_t b; - lwres_buffer_init(&b, localhost, sizeof(localhost)); - lwres_buffer_add(&b, strlen(localhost)); - (void)lwres_addr_parse(&b, &ctx->address); + /* The default is the IPv4 loopback address 127.0.0.1. */ + memset(&ctx->address, 0, sizeof(ctx->address)); + ctx->address.family = LWRES_ADDRTYPE_V4; + ctx->address.length = 4; + ctx->address.address[0] = 127; + ctx->address.address[1] = 0; + ctx->address.address[2] = 0; + ctx->address.address[3] = 1; } if (ctx->address.family == LWRES_ADDRTYPE_V4) {