interface-file: imply static executor use if gateway is specified

This commit is contained in:
Ariadne Conill 2020-08-20 03:20:07 -06:00
parent e5c592f2c1
commit 0928f07af5

View file

@ -192,6 +192,19 @@ lif_interface_file_parse(struct lif_dict *collection, const char *filename)
lif_interface_address_add(cur_iface, addr);
}
else if (!strcmp(token, "gateway"))
{
char *addr = lif_next_token(&bufp);
if (cur_iface == NULL)
{
fprintf(stderr, "%s: gateway '%s' without interface\n", filename, addr);
goto parse_error;
}
lif_interface_use_executor(cur_iface, "static");
lif_dict_add(&cur_iface->vars, token, strdup(addr));
}
else if (cur_iface != NULL)
{
token = maybe_remap_token(token);