libifupdown: interface-file: do not process use directives unless in an interface context
This commit is contained in:
parent
4e452c5fec
commit
690190a0b9
1 changed files with 6 additions and 0 deletions
|
@ -100,6 +100,12 @@ lif_interface_file_parse(struct lif_dict *collection, const char *filename)
|
|||
{
|
||||
char *executor = lif_next_token(&bufp);
|
||||
|
||||
if (cur_iface == NULL)
|
||||
{
|
||||
fprintf(stderr, "%s: use '%s' without interface\n", filename, executor);
|
||||
goto parse_error;
|
||||
}
|
||||
|
||||
/* pass requires as compatibility env vars to appropriate executors (bridge, bond) */
|
||||
if (!strcmp(executor, "dhcp"))
|
||||
cur_iface->is_dhcp = true;
|
||||
|
|
Loading…
Reference in a new issue