interface: add config setting to restrict inheritance to template interfaces
This commit is contained in:
parent
a3987b46c8
commit
5c5c316ebf
4 changed files with 14 additions and 0 deletions
|
|
@ -16,6 +16,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "libifupdown/interface.h"
|
||||
#include "libifupdown/config-file.h"
|
||||
|
||||
bool
|
||||
lif_address_parse(struct lif_address *address, const char *presentation)
|
||||
|
|
@ -239,6 +240,9 @@ lif_interface_collection_inherit(struct lif_interface *interface, struct lif_dic
|
|||
if (parent == NULL)
|
||||
return false;
|
||||
|
||||
if (!lif_config.allow_any_iface_as_template && !parent->is_template)
|
||||
return false;
|
||||
|
||||
lif_dict_add(&interface->vars, "inherit", strdup(ifname));
|
||||
interface->is_bond = parent->is_bond;
|
||||
interface->is_bridge = parent->is_bridge;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue