remove lif_interface.is_dhcp too
This commit is contained in:
parent
846df3272f
commit
e5c592f2c1
4 changed files with 3 additions and 19 deletions
|
@ -123,14 +123,9 @@ lif_interface_file_parse(struct lif_dict *collection, const char *filename)
|
||||||
while (*token)
|
while (*token)
|
||||||
{
|
{
|
||||||
if (!strcmp(token, "dhcp"))
|
if (!strcmp(token, "dhcp"))
|
||||||
{
|
|
||||||
cur_iface->is_dhcp = true;
|
|
||||||
lif_interface_use_executor(cur_iface, "dhcp");
|
lif_interface_use_executor(cur_iface, "dhcp");
|
||||||
}
|
|
||||||
else if (!strcmp(token, "ppp"))
|
else if (!strcmp(token, "ppp"))
|
||||||
{
|
|
||||||
lif_interface_use_executor(cur_iface, "ppp");
|
lif_interface_use_executor(cur_iface, "ppp");
|
||||||
}
|
|
||||||
else if (!strcmp(token, "inherits"))
|
else if (!strcmp(token, "inherits"))
|
||||||
{
|
{
|
||||||
token = lif_next_token(&bufp);
|
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) */
|
/* pass requires as compatibility env vars to appropriate executors (bridge, bond) */
|
||||||
if (!strcmp(executor, "dhcp"))
|
if (!strcmp(executor, "bridge"))
|
||||||
cur_iface->is_dhcp = true;
|
|
||||||
else if (!strcmp(executor, "bridge"))
|
|
||||||
cur_iface->is_bridge = true;
|
cur_iface->is_bridge = true;
|
||||||
else if (!strcmp(executor, "bond"))
|
else if (!strcmp(executor, "bond"))
|
||||||
cur_iface->is_bond = true;
|
cur_iface->is_bond = true;
|
||||||
else if (!strcmp(executor, "link"))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
lif_interface_use_executor(cur_iface, executor);
|
lif_interface_use_executor(cur_iface, executor);
|
||||||
}
|
}
|
||||||
|
@ -217,9 +208,7 @@ lif_interface_file_parse(struct lif_dict *collection, const char *filename)
|
||||||
free(addon);
|
free(addon);
|
||||||
|
|
||||||
/* pass requires as compatibility env vars to appropriate executors (bridge, bond) */
|
/* pass requires as compatibility env vars to appropriate executors (bridge, bond) */
|
||||||
if (!strcmp(addon, "dhcp"))
|
if (!strcmp(addon, "bridge"))
|
||||||
cur_iface->is_dhcp = true;
|
|
||||||
else if (!strcmp(addon, "bridge"))
|
|
||||||
cur_iface->is_bridge = true;
|
cur_iface->is_bridge = true;
|
||||||
else if (!strcmp(addon, "bond"))
|
else if (!strcmp(addon, "bond"))
|
||||||
cur_iface->is_bond = true;
|
cur_iface->is_bond = true;
|
||||||
|
|
|
@ -230,7 +230,6 @@ lif_interface_collection_inherit(struct lif_interface *interface, struct lif_dic
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
lif_dict_add(&interface->vars, "inherit", strdup(ifname));
|
lif_dict_add(&interface->vars, "inherit", strdup(ifname));
|
||||||
interface->is_dhcp = parent->is_dhcp;
|
|
||||||
interface->is_bond = parent->is_bond;
|
interface->is_bond = parent->is_bond;
|
||||||
interface->is_bridge = parent->is_bridge;
|
interface->is_bridge = parent->is_bridge;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ extern bool lif_address_unparse(const struct lif_address *address, char *buf, si
|
||||||
struct lif_interface {
|
struct lif_interface {
|
||||||
char *ifname;
|
char *ifname;
|
||||||
|
|
||||||
bool is_dhcp;
|
|
||||||
bool is_auto;
|
bool is_auto;
|
||||||
bool is_bridge;
|
bool is_bridge;
|
||||||
bool is_bond;
|
bool is_bond;
|
||||||
|
|
|
@ -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, "IFACE", lifname);
|
||||||
lif_environment_push(envp, "PHASE", phase);
|
lif_environment_push(envp, "PHASE", phase);
|
||||||
lif_environment_push(envp, "MODE", mode);
|
lif_environment_push(envp, "MODE", mode);
|
||||||
|
lif_environment_push(envp, "METHOD", "none");
|
||||||
/* try to provide $METHOD for ifupdown1 scripts if we can */
|
|
||||||
if (iface->is_dhcp)
|
|
||||||
lif_environment_push(envp, "METHOD", "dhcp");
|
|
||||||
|
|
||||||
if (opts->verbose)
|
if (opts->verbose)
|
||||||
lif_environment_push(envp, "VERBOSE", "1");
|
lif_environment_push(envp, "VERBOSE", "1");
|
||||||
|
|
Loading…
Reference in a new issue