remove lif_interface.is_dhcp too

This commit is contained in:
Ariadne Conill 2020-08-20 03:14:57 -06:00
parent 846df3272f
commit e5c592f2c1
4 changed files with 3 additions and 19 deletions

View file

@ -123,14 +123,9 @@ lif_interface_file_parse(struct lif_dict *collection, const char *filename)
while (*token)
{
if (!strcmp(token, "dhcp"))
{
cur_iface->is_dhcp = true;
lif_interface_use_executor(cur_iface, "dhcp");
}
else if (!strcmp(token, "ppp"))
{
lif_interface_use_executor(cur_iface, "ppp");
}
else if (!strcmp(token, "inherits"))
{
token = lif_next_token(&bufp);
@ -162,14 +157,10 @@ lif_interface_file_parse(struct lif_dict *collection, const char *filename)
}
/* pass requires as compatibility env vars to appropriate executors (bridge, bond) */
if (!strcmp(executor, "dhcp"))
cur_iface->is_dhcp = true;
else if (!strcmp(executor, "bridge"))
if (!strcmp(executor, "bridge"))
cur_iface->is_bridge = true;
else if (!strcmp(executor, "bond"))
cur_iface->is_bond = true;
else if (!strcmp(executor, "link"))
continue;
lif_interface_use_executor(cur_iface, executor);
}
@ -217,9 +208,7 @@ lif_interface_file_parse(struct lif_dict *collection, const char *filename)
free(addon);
/* pass requires as compatibility env vars to appropriate executors (bridge, bond) */
if (!strcmp(addon, "dhcp"))
cur_iface->is_dhcp = true;
else if (!strcmp(addon, "bridge"))
if (!strcmp(addon, "bridge"))
cur_iface->is_bridge = true;
else if (!strcmp(addon, "bond"))
cur_iface->is_bond = true;

View file

@ -230,7 +230,6 @@ lif_interface_collection_inherit(struct lif_interface *interface, struct lif_dic
return false;
lif_dict_add(&interface->vars, "inherit", strdup(ifname));
interface->is_dhcp = parent->is_dhcp;
interface->is_bond = parent->is_bond;
interface->is_bridge = parent->is_bridge;

View file

@ -47,7 +47,6 @@ extern bool lif_address_unparse(const struct lif_address *address, char *buf, si
struct lif_interface {
char *ifname;
bool is_dhcp;
bool is_auto;
bool is_bridge;
bool is_bond;

View file

@ -104,10 +104,7 @@ build_environment(char **envp[], const struct lif_execute_opts *opts, struct lif
lif_environment_push(envp, "IFACE", lifname);
lif_environment_push(envp, "PHASE", phase);
lif_environment_push(envp, "MODE", mode);
/* try to provide $METHOD for ifupdown1 scripts if we can */
if (iface->is_dhcp)
lif_environment_push(envp, "METHOD", "dhcp");
lif_environment_push(envp, "METHOD", "none");
if (opts->verbose)
lif_environment_push(envp, "VERBOSE", "1");