From 543eeae2382e5de0b9518bdd9f7a75e5686fd056 Mon Sep 17 00:00:00 2001 From: dm <> Date: Mon, 19 Feb 1996 19:53:30 +0000 Subject: netbsd: bind 4.9.3 --- src/lib/libc/net/res_init.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'src/lib/libc/net/res_init.c') diff --git a/src/lib/libc/net/res_init.c b/src/lib/libc/net/res_init.c index 33cc8d39f1..ff8e1b1e5e 100644 --- a/src/lib/libc/net/res_init.c +++ b/src/lib/libc/net/res_init.c @@ -1,4 +1,4 @@ -/* $NetBSD: res_init.c,v 1.8 1995/06/03 22:33:36 mycroft Exp $ */ +/* $NetBSD: res_init.c,v 1.9 1996/02/02 15:22:30 mrg Exp $ */ /*- * Copyright (c) 1985, 1989, 1993 @@ -56,9 +56,9 @@ #if defined(LIBC_SCCS) && !defined(lint) #if 0 static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; -static char rcsid[] = "$Id: res_init.c,v 4.9.1.1 1993/05/02 22:43:03 vixie Rel "; +static char rcsid[] = "$Id: res_init.c,v 8.3 1995/06/29 09:26:28 vixie Exp "; #else -static char rcsid[] = "$NetBSD: res_init.c,v 1.8 1995/06/03 22:33:36 mycroft Exp $"; +static char rcsid[] = "$NetBSD: res_init.c,v 1.9 1996/02/02 15:22:30 mrg Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -92,11 +92,23 @@ struct __res_state _res = { * there will have precedence. Otherwise, the server address is set to * INADDR_ANY and the default domain name comes from the gethostname(). * - * The configuration file should only be used if you want to redefine your - * domain or run without a server on your machine. + * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1 + * rather than INADDR_ANY ("0.0.0.0") as the default name server address + * since it was noted that INADDR_ANY actually meant ``the first interface + * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface, + * it had to be "up" in order for you to reach your own name server. It + * was later decided that since the recommended practice is to always + * install local static routes through 127.0.0.1 for all your network + * interfaces, that we could solve this problem without a code change. + * + * The configuration file should always be used, since it is the only way + * to specify a default domain. If you are running a server on your local + * machine, you should say "nameserver 0.0.0.0" or "nameserver 127.0.0.1" + * in the configuration file. * * Return 0 if completes successfully, -1 on error */ +int res_init() { register FILE *fp; @@ -107,6 +119,7 @@ res_init() int haveenv = 0; int havesearch = 0; int nsort = 0; + int dots; u_long mask; _res.nsaddr.sin_len = sizeof(struct sockaddr_in); @@ -392,3 +405,12 @@ net_mask(in) /* XXX - should really use system's version of this */ return (htonl(IN_CLASSB_NET)); return (htonl(IN_CLASSC_NET)); } + +u_int16_t +res_randomid() +{ + struct timeval now; + + gettimeofday(&now, NULL); + return (0xffff & (now.tv_sec ^ now.tv_usec ^ getpid())); +} -- cgit v1.2.3-55-g6feb