2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-28 21:07:43 +00:00

Make it a warning rather than an error if resolv.conf is missing.

This commit is contained in:
Ted Lemon 1997-06-08 04:05:21 +00:00
parent 9868534313
commit 732a90b290
4 changed files with 64 additions and 51 deletions

View File

@ -16,6 +16,8 @@
address and the lease corresponding to that address is available to address and the lease corresponding to that address is available to
that client. that client.
- Make it a warning rather than an error if resolv.conf is missing.
970605 970605
- Add client-hostname token to lexer so that the parser can use it. - Add client-hostname token to lexer so that the parser can use it.

View File

@ -48,7 +48,7 @@
#ifndef lint #ifndef lint
static char copyright[] = static char copyright[] =
"$Id: dns.c,v 1.3 1997/05/09 08:02:33 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n"; "$Id: dns.c,v 1.4 1997/06/08 04:05:20 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@ -198,6 +198,9 @@ static int nslookup (id, qname, namelen, qtype, qclass)
int i, status; int i, status;
struct sockaddr_in *server = pick_name_server (); struct sockaddr_in *server = pick_name_server ();
if (!server)
return 0;
/* Construct a header... */ /* Construct a header... */
hdr = (HEADER *)query; hdr = (HEADER *)query;
memset (hdr, 0, sizeof *hdr); memset (hdr, 0, sizeof *hdr);
@ -255,6 +258,9 @@ static int zonelookup (id, qname, namelen, qclass)
int i, status, count; int i, status, count;
struct sockaddr_in *server = pick_name_server (); struct sockaddr_in *server = pick_name_server ();
if (!server)
return 0;
/* Construct a header... */ /* Construct a header... */
hdr = (HEADER *)query; hdr = (HEADER *)query;
memset (hdr, 0, sizeof *hdr); memset (hdr, 0, sizeof *hdr);

View File

@ -42,7 +42,7 @@
#ifndef lint #ifndef lint
static char copyright[] = static char copyright[] =
"$Id: resolv.c,v 1.3 1997/06/03 00:47:40 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; "$Id: resolv.c,v 1.4 1997/06/08 04:05:20 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@ -66,8 +66,11 @@ void read_resolv_conf (parse_time)
new_parse (path_resolv_conf); new_parse (path_resolv_conf);
eol_token = 1; eol_token = 1;
if ((cfile = fopen (path_resolv_conf, "r")) == NULL) if ((cfile = fopen (path_resolv_conf, "r")) == NULL) {
error ("Can't open %s: %m", path_resolv_conf); warn ("Can't open %s: %m", path_resolv_conf);
return;
}
do { do {
token = next_token (&val, cfile); token = next_token (&val, cfile);
if (token == EOF) if (token == EOF)
@ -184,8 +187,10 @@ struct sockaddr_in *pick_name_server ()
/* Check /etc/resolv.conf and reload it if it's changed. */ /* Check /etc/resolv.conf and reload it if it's changed. */
if (cur_time > rcdate) { if (cur_time > rcdate) {
if (stat (path_resolv_conf, &st) < 0) if (stat (path_resolv_conf, &st) < 0) {
error ("Can't stat %s", path_resolv_conf); warn ("Can't stat %s", path_resolv_conf);
return (struct sockaddr_in *)0;
}
if (st.st_mtime > rcdate) { if (st.st_mtime > rcdate) {
char rcbuf [512]; char rcbuf [512];
char *s, *t, *u; char *s, *t, *u;

View File

@ -98,6 +98,16 @@ dhcpd(8) dhcpd(8)
database, dhcpd does not automatically restart itself when database, dhcpd does not automatically restart itself when
it sees a change to the dhcpd.conf file. it sees a change to the dhcpd.conf file.
Note: We get a lot of complaints about this. We realize
that it would be nice if one could send a SIGHUP to the
server and have it reload the database. This is not
technically impossible, but it would require a great deal
of work, our resources are extremely limited, and they can
be better spent elsewhere. So please don't complain
about this on the mailing list unless you're prepared to
fund a project to implement this feature, or prepared to
do it yourself.
CCOOMMMMAANNDD LLIINNEE CCOOMMMMAANNDD LLIINNEE
The names of the network interfaces on which dhcpd should The names of the network interfaces on which dhcpd should
listen for broadcasts may be specified on the command listen for broadcasts may be specified on the command
@ -114,16 +124,6 @@ CCOOMMMMAANNDD LLIINNEE
the udp port number on which dhcpd should listen. This is the udp port number on which dhcpd should listen. This is
mostly useful for debugging purposes. mostly useful for debugging purposes.
To run dhcpd as a foreground process, rather than allowing
it to run as a daemon in the background, the --ff flag
should be specified. This is useful when running dhcpd
under a debugger, or when running it out of inittab on
System V systems.
To have dhcpd log to the standard error descriptor, spec-
ify the --dd flag. This can be useful for debugging, and
also at sites where a complete log of all dhcp activity
must be kept but syslogd is not reliable or otherwise
@ -136,8 +136,18 @@ CCOOMMMMAANNDD LLIINNEE
dhcpd(8) dhcpd(8) dhcpd(8) dhcpd(8)
cannot be used. Normally, dhcpd will log all output To run dhcpd as a foreground process, rather than allowing
using the syslog(3) function with the log facility set to it to run as a daemon in the background, the --ff flag
should be specified. This is useful when running dhcpd
under a debugger, or when running it out of inittab on
System V systems.
To have dhcpd log to the standard error descriptor, spec-
ify the --dd flag. This can be useful for debugging, and
also at sites where a complete log of all dhcp activity
must be kept but syslogd is not reliable or otherwise can-
not be used. Normally, dhcpd will log all output using
the syslog(3) function with the log facility set to
LOG_DAEMON. LOG_DAEMON.
Dhcpd can be made to use an alternate configuration file Dhcpd can be made to use an alternate configuration file
@ -179,17 +189,7 @@ SSuubbnneettss
left out entirely, but the subnet statement must appear. left out entirely, but the subnet statement must appear.
LLeeaassee LLeennggtthhss
DHCP leases can be assigned almost any length from zero
seconds to infinity. What lease length makes sense for
any given subnet, or for any given installation, will vary
depending on the kinds of hosts being served.
For example, in an office environment where systems are
added from time to time and removed from time to time, but
move relatively infrequently, it might make sense to allow
lease times of a month of more. In a final test environ-
ment on a manufacturing floor, it may make more sense to
@ -202,6 +202,17 @@ LLeeaassee LLeennggtthhss
dhcpd(8) dhcpd(8) dhcpd(8) dhcpd(8)
LLeeaassee LLeennggtthhss
DHCP leases can be assigned almost any length from zero
seconds to infinity. What lease length makes sense for
any given subnet, or for any given installation, will vary
depending on the kinds of hosts being served.
For example, in an office environment where systems are
added from time to time and removed from time to time, but
move relatively infrequently, it might make sense to allow
lease times of a month of more. In a final test environ-
ment on a manufacturing floor, it may make more sense to
assign a maximum lease length of 30 minutes - enough time assign a maximum lease length of 30 minutes - enough time
to go through a simple test procedure on a network appli- to go through a simple test procedure on a network appli-
ance before packaging it up for delivery. ance before packaging it up for delivery.
@ -244,18 +255,7 @@ BBOOOOTTPP SSuuppppoorrtt
filename "/tftpboot/haagen.boot"; filename "/tftpboot/haagen.boot";
} }
OOppttiioonnss
DHCP (and also BOOTP with Vendor Extensions) provide a
mechanism whereby the server can provide the client with
information about how to configure its network interface
(e.g., subnet mask), and also how the client can access
various network services (e.g., DNS, IP routers, and so
on).
These options can be specified on a per-subnet basis, and,
for BOOTP clients, also on a per-client basis. In the
event that a BOOTP client declaration specifies options
that are also specified in its subnet declaration, the
@ -268,6 +268,18 @@ OOppttiioonnss
dhcpd(8) dhcpd(8) dhcpd(8) dhcpd(8)
OOppttiioonnss
DHCP (and also BOOTP with Vendor Extensions) provide a
mechanism whereby the server can provide the client with
information about how to configure its network interface
(e.g., subnet mask), and also how the client can access
various network services (e.g., DNS, IP routers, and so
on).
These options can be specified on a per-subnet basis, and,
for BOOTP clients, also on a per-client basis. In the
event that a BOOTP client declaration specifies options
that are also specified in its subnet declaration, the
options specified in the client declaration take prece- options specified in the client declaration take prece-
dence. An reasonably complete DHCP configuration might dence. An reasonably complete DHCP configuration might
look something like this: look something like this:
@ -313,18 +325,6 @@ AAUUTTHHOORR
5 5