From a3987b46c8045e5a1b044d6879147eede72a75c6 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Wed, 23 Sep 2020 11:29:01 -0600 Subject: [PATCH] interface-file: mark interface as template if `template` keyword is used --- libifupdown/interface-file.c | 6 ++++++ libifupdown/interface.h | 1 + 2 files changed, 7 insertions(+) diff --git a/libifupdown/interface-file.c b/libifupdown/interface-file.c index f9d70dc..d75e53e 100644 --- a/libifupdown/interface-file.c +++ b/libifupdown/interface-file.c @@ -236,6 +236,12 @@ handle_iface(struct lif_dict *collection, const char *filename, size_t lineno, c return false; } + /* mark the cur_iface as a template iface if `template` keyword + * is used. + */ + if (!strcmp(token, "template")) + cur_iface->is_template = true; + /* in original ifupdown config, we can have "inet loopback" * or "inet dhcp" or such to designate hints. lets pick up * those hints here. diff --git a/libifupdown/interface.h b/libifupdown/interface.h index d627610..c36690d 100644 --- a/libifupdown/interface.h +++ b/libifupdown/interface.h @@ -50,6 +50,7 @@ struct lif_interface { bool is_auto; bool is_bridge; bool is_bond; + bool is_template; struct lif_dict vars;