1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
diff -ur dhcp-current/client/clparse.c dhcp-rentec/client/clparse.c
--- dhcp-current/client/clparse.c Tue Jun 26 20:29:27 2001
+++ dhcp-rentec/client/clparse.c Thu Oct 17 16:37:31 2002
@@ -599,34 +599,41 @@
struct parse *cfile;
u_int32_t **list;
{
- int ix, i;
+ int ix;
int token;
const char *val;
pair p = (pair)0, q, r;
+ struct option *option;
ix = 0;
do {
- token = next_token (&val, (unsigned *)0, cfile);
- if (token == SEMI)
+ token = peek_token (&val, (unsigned *)0, cfile);
+ if (token == SEMI) {
+ token = next_token (&val, (unsigned *)0, cfile);
break;
+ }
if (!is_identifier (token)) {
parse_warn (cfile, "%s: expected option name.", val);
+ token = next_token (&val, (unsigned *)0, cfile);
skip_to_semi (cfile);
return;
}
- for (i = 0; i < 256; i++) {
- if (!strcasecmp (dhcp_options [i].name, val))
- break;
+ option = parse_option_name (cfile, 0, NULL);
+ if (!option) {
+ parse_warn (cfile, "expected option name.");
+ return;
}
- if (i == 256) {
- parse_warn (cfile, "%s: expected option name.", val);
+ if (option -> universe != &dhcp_universe) {
+ parse_warn (cfile, "%s.%s: Only global options allowed.",
+ option -> universe -> name,
+ option -> name);
skip_to_semi (cfile);
return;
}
r = new_pair (MDL);
if (!r)
log_fatal ("can't allocate pair for option code.");
- r -> car = (caddr_t)(long)i;
+ r -> car = (caddr_t)(long)option -> code;
r -> cdr = (pair)0;
if (p)
q -> cdr = r;
|