summaryrefslogtreecommitdiffstats
path: root/contrib/bind/lib/resolv/res_init.c
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2002-07-01 01:07:56 +0000
committerdougb <dougb@FreeBSD.org>2002-07-01 01:07:56 +0000
commitf4bd5053ab2eb505b16099244427d9e93442fe90 (patch)
tree2b447904bb3b9c0f6670bba10470d09a443c9a2e /contrib/bind/lib/resolv/res_init.c
parent52cf506b39ec774bba7e719390541e881296c3c4 (diff)
downloadFreeBSD-src-f4bd5053ab2eb505b16099244427d9e93442fe90.zip
FreeBSD-src-f4bd5053ab2eb505b16099244427d9e93442fe90.tar.gz
Import of ISC BIND version 8.3.3
Diffstat (limited to 'contrib/bind/lib/resolv/res_init.c')
-rw-r--r--contrib/bind/lib/resolv/res_init.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/contrib/bind/lib/resolv/res_init.c b/contrib/bind/lib/resolv/res_init.c
index 8dc72f4..9f99d14 100644
--- a/contrib/bind/lib/resolv/res_init.c
+++ b/contrib/bind/lib/resolv/res_init.c
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
-static const char rcsid[] = "$Id: res_init.c,v 8.28 2002/01/30 01:07:35 marka Exp $";
+static const char rcsid[] = "$Id: res_init.c,v 8.29 2002/05/31 06:05:31 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
@@ -194,7 +194,8 @@ __res_vinit(res_state statp, int preinit) {
if (statp->_u._ext.ext != NULL) {
memset(statp->_u._ext.ext, 0, sizeof(*statp->_u._ext.ext));
statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr;
- strcpy(statp->_u._ext.ext->nsuffix, "ip6.int");
+ strcpy(statp->_u._ext.ext->nsuffix, "ip6.arpa");
+ strcpy(statp->_u._ext.ext->nsuffix2, "ip6.int");
strcpy(statp->_u._ext.ext->bsuffix, "ip6.arpa");
}
#ifdef RESOLVSORT
@@ -520,6 +521,14 @@ res_setoptions(res_state statp, const char *options, const char *source)
strncpy(ext->nsuffix, cp, i);
ext->nsuffix[i] = '\0';
}
+ else if (!strncmp(cp, "nibble2:", sizeof("nibble2:") - 1)) {
+ if (ext == NULL)
+ goto skip;
+ cp += sizeof("nibble2:") - 1;
+ i = MIN(strcspn(cp, " \t"), sizeof(ext->nsuffix2) - 1);
+ strncpy(ext->nsuffix2, cp, i);
+ ext->nsuffix2[i] = '\0';
+ }
else if (!strncmp(cp, "bitstring:", sizeof("bitstring:") - 1)) {
if (ext == NULL)
goto skip;
@@ -530,16 +539,12 @@ res_setoptions(res_state statp, const char *options, const char *source)
}
else if (!strncmp(cp, "v6revmode:", sizeof("v6revmode:") - 1)) {
cp += sizeof("v6revmode:") - 1;
- if (!strncmp(cp, "nibble", sizeof("nibble") - 1)) {
- statp->options &= ~RES_NO_NIBBLE;
- statp->options |= RES_NO_BITSTRING;
- } else if (!strncmp(cp, "bitstring",
- sizeof("bitstring") - 1)) {
- statp->options |= RES_NO_NIBBLE;
- statp->options &= ~RES_NO_BITSTRING;
+ /* "nibble" and "bitstring" used to be valid */
+ if (!strncmp(cp, "single", sizeof("single") - 1)) {
+ statp->options |= RES_NO_NIBBLE2;
} else if (!strncmp(cp, "both", sizeof("both") - 1)) {
statp->options &=
- ~(RES_NO_NIBBLE|RES_NO_BITSTRING);
+ ~RES_NO_NIBBLE2;
}
}
else {
@@ -613,6 +618,13 @@ const char *
res_get_nibblesuffix(res_state statp) {
if (statp->_u._ext.ext)
return (statp->_u._ext.ext->nsuffix);
+ return ("ip6.arpa");
+}
+
+const char *
+res_get_nibblesuffix2(res_state statp) {
+ if (statp->_u._ext.ext)
+ return (statp->_u._ext.ext->nsuffix2);
return ("ip6.int");
}
OpenPOWER on IntegriCloud