res_init.c (298226) | res_init.c (298830) |
---|---|
1/* 2 * Copyright (c) 1985, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 55 unchanged lines hidden (view full) --- 64 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 65 */ 66 67#if defined(LIBC_SCCS) && !defined(lint) 68static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; 69static const char rcsid[] = "$Id: res_init.c,v 1.26 2008/12/11 09:59:00 marka Exp $"; 70#endif /* LIBC_SCCS and not lint */ 71#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1985, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 55 unchanged lines hidden (view full) --- 64 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 65 */ 66 67#if defined(LIBC_SCCS) && !defined(lint) 68static const char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93"; 69static const char rcsid[] = "$Id: res_init.c,v 1.26 2008/12/11 09:59:00 marka Exp $"; 70#endif /* LIBC_SCCS and not lint */ 71#include <sys/cdefs.h> |
72__FBSDID("$FreeBSD: head/lib/libc/resolv/res_init.c 298226 2016-04-18 21:05:15Z avos $"); | 72__FBSDID("$FreeBSD: head/lib/libc/resolv/res_init.c 298830 2016-04-30 01:24:24Z pfg $"); |
73 74#include "port_before.h" 75 76#include "namespace.h" 77 78#include <sys/param.h> 79#include <sys/socket.h> 80#include <sys/stat.h> --- 58 unchanged lines hidden (view full) --- 139 * Resolver state default settings. 140 */ 141 142/*% 143 * Set up default settings. If the configuration file exist, the values 144 * there will have precedence. Otherwise, the server address is set to 145 * INADDR_ANY and the default domain name comes from the gethostname(). 146 * | 73 74#include "port_before.h" 75 76#include "namespace.h" 77 78#include <sys/param.h> 79#include <sys/socket.h> 80#include <sys/stat.h> --- 58 unchanged lines hidden (view full) --- 139 * Resolver state default settings. 140 */ 141 142/*% 143 * Set up default settings. If the configuration file exist, the values 144 * there will have precedence. Otherwise, the server address is set to 145 * INADDR_ANY and the default domain name comes from the gethostname(). 146 * |
147 * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1 | 147 * An interim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1 |
148 * rather than INADDR_ANY ("0.0.0.0") as the default name server address 149 * since it was noted that INADDR_ANY actually meant ``the first interface 150 * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface, 151 * it had to be "up" in order for you to reach your own name server. It 152 * was later decided that since the recommended practice is to always 153 * install local static routes through 127.0.0.1 for all your network 154 * interfaces, that we could solve this problem without a code change. 155 * --- 6 unchanged lines hidden (view full) --- 162 */ 163int 164res_ninit(res_state statp) { 165 extern int __res_vinit(res_state, int); 166 167 return (__res_vinit(statp, 0)); 168} 169 | 148 * rather than INADDR_ANY ("0.0.0.0") as the default name server address 149 * since it was noted that INADDR_ANY actually meant ``the first interface 150 * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface, 151 * it had to be "up" in order for you to reach your own name server. It 152 * was later decided that since the recommended practice is to always 153 * install local static routes through 127.0.0.1 for all your network 154 * interfaces, that we could solve this problem without a code change. 155 * --- 6 unchanged lines hidden (view full) --- 162 */ 163int 164res_ninit(res_state statp) { 165 extern int __res_vinit(res_state, int); 166 167 return (__res_vinit(statp, 0)); 168} 169 |
170/*% This function has to be reachable by res_data.c but not publically. */ | 170/*% This function has to be reachable by res_data.c but not publicly. */ |
171int 172__res_vinit(res_state statp, int preinit) { 173 FILE *fp; 174 char *cp, **pp; 175 int n; 176 char buf[BUFSIZ]; 177 int nserv = 0; /*%< number of nameserver records read from file */ 178 int haveenv = 0; --- 769 unchanged lines hidden --- | 171int 172__res_vinit(res_state statp, int preinit) { 173 FILE *fp; 174 char *cp, **pp; 175 int n; 176 char buf[BUFSIZ]; 177 int nserv = 0; /*%< number of nameserver records read from file */ 178 int haveenv = 0; --- 769 unchanged lines hidden --- |