interface file: simplify scanning iface directives for relevant keywords
This commit is contained in:
parent
1964a99e5d
commit
0eb25f1d62
1 changed files with 9 additions and 11 deletions
|
@ -82,19 +82,17 @@ lif_interface_file_parse(struct lif_dict *collection, const char *filename)
|
|||
* or "inet dhcp" or such to designate hints. lets pick up
|
||||
* those hints here.
|
||||
*/
|
||||
char *inet_type = lif_next_token(&bufp);
|
||||
if (!*inet_type)
|
||||
continue;
|
||||
|
||||
char *hint = lif_next_token(&bufp);
|
||||
if (!*hint)
|
||||
continue;
|
||||
|
||||
if (!strcmp(hint, "dhcp"))
|
||||
char *token = lif_next_token(&bufp);
|
||||
while (*token)
|
||||
{
|
||||
if (!strcmp(token, "dhcp"))
|
||||
{
|
||||
cur_iface->is_dhcp = true;
|
||||
lif_dict_add(&cur_iface->vars, "use", strdup("dhcp"));
|
||||
}
|
||||
|
||||
token = lif_next_token(&bufp);
|
||||
}
|
||||
}
|
||||
else if (!strcmp(token, "use"))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue