diff options
author | David Hankins <dhankins@isc.org> | 2006-02-24 23:16:32 +0000 |
---|---|---|
committer | David Hankins <dhankins@isc.org> | 2006-02-24 23:16:32 +0000 |
commit | 88cd8aca9efa1e5b867ac498b98e972638f7aee8 (patch) | |
tree | 8d3015eda99ca77265ed79d15b6e1f0200f6bab3 /common/conflex.c | |
parent | b43c87ad595026da002f7acca54bf24318d9fed2 (diff) | |
download | isc-dhcp-88cd8aca9efa1e5b867ac498b98e972638f7aee8.tar.gz |
- Merge changes between 3.0.3RC1 and 3.0.4-BETA-3 into HEAD (silence
robie).
Diffstat (limited to 'common/conflex.c')
-rw-r--r-- | common/conflex.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/common/conflex.c b/common/conflex.c index 509b9911..55b8face 100644 --- a/common/conflex.c +++ b/common/conflex.c @@ -3,7 +3,7 @@ Lexical scanner for dhcpd config file... */ /* - * Copyright (c) 2004-2005 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2004-2006 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1995-2003 by Internet Software Consortium * * Permission to use, copy, modify, and distribute this software for any @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: conflex.c,v 1.95 2005/03/17 20:14:57 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n"; +"$Id: conflex.c,v 1.96 2006/02/24 23:16:28 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -95,10 +95,14 @@ isc_result_t new_parse (cfile, file, inbuf, buflen, name, eolp) isc_result_t end_parse (cfile) struct parse **cfile; { - if ((*cfile) -> bufsiz) - dfree ((*cfile) -> inbuf, MDL); - dfree (*cfile, MDL); - *cfile = (struct parse *)0; + /* "Memory" config files have no file. */ + if ((*cfile)->file != -1) + close((*cfile)->file); + + if ((*cfile)->bufsiz) + dfree((*cfile)->inbuf, MDL); + dfree(*cfile, MDL); + *cfile = NULL; return ISC_R_SUCCESS; } @@ -464,7 +468,7 @@ static enum dhcp_token read_number (c, cfile) log_fatal("read_number():%s:%d: impossible case", MDL); } #else /* OLD_LEXER */ - if (!seenx && (c == 'x') { + if (!seenx && (c == 'x')) { seenx = 1; } else if (!isascii (c) || !isxdigit (c)) { if (c != EOF) { @@ -573,6 +577,8 @@ static enum dhcp_token intern (atom, dfv) return ADDRESS; if (!strcasecmp (atom + 1, "ctive")) return TOKEN_ACTIVE; + if (!strcasecmp (atom + 1, "tsfp")) + return ATSFP; break; case 'b': if (!strcasecmp (atom + 1, "ackup")) |