interface-file: do not allow templates to be set as automatic

This commit is contained in:
Ariadne Conill 2020-09-23 11:38:29 -06:00
parent 41a71173d1
commit 94f00b2fdc

View file

@ -162,7 +162,9 @@ handle_auto(struct lif_dict *collection, const char *filename, size_t lineno, ch
return false; return false;
} }
cur_iface->is_auto = true; if (!cur_iface->is_template)
cur_iface->is_auto = true;
return true; return true;
} }
@ -240,7 +242,10 @@ handle_iface(struct lif_dict *collection, const char *filename, size_t lineno, c
* is used. * is used.
*/ */
if (!strcmp(token, "template")) if (!strcmp(token, "template"))
{
cur_iface->is_auto = false;
cur_iface->is_template = true; cur_iface->is_template = true;
}
/* in original ifupdown config, we can have "inet loopback" /* in original ifupdown config, we can have "inet loopback"
* or "inet dhcp" or such to designate hints. lets pick up * or "inet dhcp" or such to designate hints. lets pick up