diff --git a/libifupdown/interface-file.c b/libifupdown/interface-file.c index 4d6f63a..74d74c1 100644 --- a/libifupdown/interface-file.c +++ b/libifupdown/interface-file.c @@ -90,6 +90,22 @@ lif_interface_file_parse(struct lif_dict *collection, const char *filename) cur_iface->is_dhcp = true; lif_dict_add(&cur_iface->vars, "use", strdup("dhcp")); } + else if (!strcmp(token, "inherits")) + { + token = lif_next_token(&bufp); + + if (!*token) + { + fprintf(stderr, "%s: inherits without interface\n", filename); + goto parse_error; + } + + if (!lif_interface_collection_inherit(cur_iface, collection, token)) + { + fprintf(stderr, "%s: could not inherit %s\n", filename, token); + goto parse_error; + } + } token = lif_next_token(&bufp); } @@ -121,6 +137,22 @@ lif_interface_file_parse(struct lif_dict *collection, const char *filename) lif_dict_add(&cur_iface->vars, token, strdup(executor)); } + else if (!strcmp(token, "inherit")) + { + token = lif_next_token(&bufp); + + if (!*token) + { + fprintf(stderr, "%s: inherits without interface\n", filename); + goto parse_error; + } + + if (!lif_interface_collection_inherit(cur_iface, collection, token)) + { + fprintf(stderr, "%s: could not inherit %s\n", filename, token); + goto parse_error; + } + } else if (!strcmp(token, "address")) { char *addr = lif_next_token(&bufp);