From 0928f07af513276febad98b2da6890b8300badee Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 20 Aug 2020 03:20:07 -0600 Subject: [PATCH] interface-file: imply static executor use if gateway is specified --- libifupdown/interface-file.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libifupdown/interface-file.c b/libifupdown/interface-file.c index 4eaedd1..1f2d19d 100644 --- a/libifupdown/interface-file.c +++ b/libifupdown/interface-file.c @@ -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);