summaryrefslogtreecommitdiff
path: root/common/conflex.c
diff options
context:
space:
mode:
authorDavid Hankins <dhankins@isc.org>2009-06-17 21:42:04 +0000
committerDavid Hankins <dhankins@isc.org>2009-06-17 21:42:04 +0000
commit792156a9045b6838f9c970573d7460dfbaaf9e08 (patch)
treed1ab8a8d30dfc5508eddcf6da69c4fd3c1e42ff3 /common/conflex.c
parenta41d7a251ee96bd672fcff2f2f378049e467e931 (diff)
downloadisc-dhcp-792156a9045b6838f9c970573d7460dfbaaf9e08.tar.gz
- A bug was fixed that caused the 'conflict-done' state to fail to be parsed
in failover state records. [ISC-Bugs #19739]
Diffstat (limited to 'common/conflex.c')
-rw-r--r--common/conflex.c95
1 files changed, 59 insertions, 36 deletions
diff --git a/common/conflex.c b/common/conflex.c
index 3625a78d..e7426417 100644
--- a/common/conflex.c
+++ b/common/conflex.c
@@ -778,46 +778,69 @@ intern(char *atom, enum dhcp_token dfv) {
return BOUND;
break;
case 'c':
- if (!strcasecmp (atom + 1, "ase"))
+ if (!strcasecmp(atom + 1, "ase"))
return CASE;
- if (!strcasecmp (atom + 1, "ommit"))
- return COMMIT;
- if (!strcasecmp (atom + 1, "ode"))
- return CODE;
- if (!strcasecmp (atom + 1, "onfig-option"))
- return CONFIG_OPTION;
- if (!strcasecmp (atom + 1, "heck"))
+ if (!strcasecmp(atom + 1, "heck"))
return CHECK;
- if (!strcasecmp (atom + 1, "lass"))
- return CLASS;
- if (!strcasecmp (atom + 1, "lose"))
- return TOKEN_CLOSE;
- if (!strcasecmp(atom + 1, "ompressed"))
- return COMPRESSED;
- if (!strcasecmp (atom + 1, "reate"))
- return TOKEN_CREATE;
- if (!strcasecmp (atom + 1, "iaddr"))
+ if (!strcasecmp(atom + 1, "iaddr"))
return CIADDR;
- if (!strncasecmp (atom + 1, "lient", 5)) {
- if (!strcasecmp (atom + 6, "-identifier"))
- return CLIENT_IDENTIFIER;
- if (!strcasecmp (atom + 6, "-hostname"))
- return CLIENT_HOSTNAME;
- if (!strcasecmp (atom + 6, "-state"))
- return CLIENT_STATE;
- if (!strcasecmp (atom + 6, "-updates"))
- return CLIENT_UPDATES;
- if (!strcasecmp (atom + 6, "s"))
- return CLIENTS;
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'l') {
+ if (!strcasecmp(atom + 2, "ass"))
+ return CLASS;
+ if (!strncasecmp(atom + 2, "ient", 4)) {
+ if (!strcasecmp(atom + 6, "s"))
+ return CLIENTS;
+ if (atom[7] == '-') {
+ if (!strcasecmp(atom + 7, "hostname"))
+ return CLIENT_HOSTNAME;
+ if (!strcasecmp(atom + 7, "identifier"))
+ return CLIENT_IDENTIFIER;
+ if (!strcasecmp(atom + 7, "state"))
+ return CLIENT_STATE;
+ if (!strcasecmp(atom + 7, "updates"))
+ return CLIENT_UPDATES;
+ break;
+ }
+ break;
+ }
+ if (!strcasecmp(atom + 2, "ose"))
+ return TOKEN_CLOSE;
+ if (!strcasecmp(atom + 2, "tt"))
+ return CLTT;
+ break;
}
- if (!strcasecmp (atom + 1, "oncat"))
- return CONCAT;
- if (!strcasecmp (atom + 1, "onnect"))
- return CONNECT;
- if (!strcasecmp (atom + 1, "ommunications-interrupted"))
- return COMMUNICATIONS_INTERRUPTED;
- if (!strcasecmp (atom + 1, "ltt"))
- return CLTT;
+ if (isascii(atom[1]) &&
+ tolower((unsigned char)atom[1]) == 'o') {
+ if (!strcasecmp(atom + 2, "de"))
+ return CODE;
+ if (isascii(atom[2]) &&
+ tolower((unsigned char)atom[2]) == 'm') {
+ if (!strcasecmp(atom + 3, "mit"))
+ return COMMIT;
+ if (!strcasecmp(atom + 3,
+ "munications-interrupted"))
+ return COMMUNICATIONS_INTERRUPTED;
+ if (!strcasecmp(atom + 3, "pressed"))
+ return COMPRESSED;
+ break;
+ }
+ if (isascii(atom[2]) &&
+ tolower((unsigned char)atom[2]) == 'n') {
+ if (!strcasecmp(atom + 3, "cat"))
+ return CONCAT;
+ if (!strcasecmp(atom + 3, "fig-option"))
+ return CONFIG_OPTION;
+ if (!strcasecmp(atom + 3, "flict-done"))
+ return CONFLICT_DONE;
+ if (!strcasecmp(atom + 3, "nect"))
+ return CONNECT;
+ break;
+ }
+ break;
+ }
+ if (!strcasecmp(atom + 1, "reate"))
+ return TOKEN_CREATE;
break;
case 'd':
if (!strcasecmp(atom + 1, "b-time-format"))