mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Fix InterfaceStack issue case Lowerlayer is Ethernet.Link.
This commit is contained in:
parent
a9e1a747b4
commit
e9755c741e
2 changed files with 28 additions and 2 deletions
|
|
@ -36,6 +36,21 @@ static char *get_instance_by_section(int mode, char *dmmap_config, char *section
|
|||
return instance;
|
||||
}
|
||||
|
||||
static char *get_instance_by_section_option_condition(int mode, char *dmmap_config, char *section, struct uci_section *s, char *option, char *value, char *instance_option, char *alias_option)
|
||||
{
|
||||
struct uci_section *dmmap_section;
|
||||
char *instance = "";
|
||||
|
||||
get_dmmap_section_of_config_section_cont(dmmap_config, section, option, value, &dmmap_section);
|
||||
|
||||
if (mode == INSTANCE_MODE_NUMBER)
|
||||
dmuci_get_value_by_section_string(dmmap_section, instance_option, &instance);
|
||||
else
|
||||
dmuci_get_value_by_section_string(dmmap_section, alias_option, &instance);
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
static char *get_alias_by_section(char *dmmap_config, char *section, struct uci_section *s, char *alias_option)
|
||||
{
|
||||
struct uci_section *dmmap_section;
|
||||
|
|
@ -126,7 +141,7 @@ int browseInterfaceStackInst(struct dmctx *dmctx, DMNODE *parent_node, void *pre
|
|||
if (vid) *vid = '\0';
|
||||
adm_entry_get_linker_param(dmctx, dm_print_path("%s%cEthernet%cLink%c", dmroot, dm_delim, dm_delim, dm_delim), linker, &value);
|
||||
loweralias = get_alias_by_section("dmmap", "link", s, "link_alias");
|
||||
layer_inst = get_instance_by_section(dmctx->instance_mode, "dmmap", "link", s, "section_name", section_name(s), "link_instance", "link_alias");
|
||||
layer_inst = get_instance_by_section_option_condition(dmctx->instance_mode, "dmmap", "link", s, "section_name", section_name(s), "link_instance", "link_alias");
|
||||
if (value == NULL)
|
||||
value = "";
|
||||
}
|
||||
|
|
@ -201,7 +216,7 @@ int browseInterfaceStackInst(struct dmctx *dmctx, DMNODE *parent_node, void *pre
|
|||
if (vid) *vid = '\0';
|
||||
adm_entry_get_linker_param(dmctx, dm_print_path("%s%cEthernet%cLink%c", dmroot, dm_delim, dm_delim, dm_delim), linker, &value);
|
||||
loweralias = get_alias_by_section("dmmap", "link", s, "link_alias");
|
||||
layer_inst = get_instance_by_section(dmctx->instance_mode, "dmmap", "link", s, "section_name", section_name(s), "link_instance", "link_alias");
|
||||
layer_inst = get_instance_by_section_option_condition(dmctx->instance_mode, "dmmap", "link", s, "section_name", section_name(s), "link_instance", "link_alias");
|
||||
if (value == NULL)
|
||||
value = "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -819,6 +819,17 @@ void get_dmmap_section_of_config_section_eq(char* dmmap_package, char* section_t
|
|||
*dmmap_section = NULL;
|
||||
}
|
||||
|
||||
void get_dmmap_section_of_config_section_cont(char* dmmap_package, char* section_type, char *opt, char* value, struct uci_section **dmmap_section)
|
||||
{
|
||||
struct uci_section* s;
|
||||
|
||||
uci_path_foreach_option_cont(bbfdm, dmmap_package, section_type, opt, value, s) {
|
||||
*dmmap_section = s;
|
||||
return;
|
||||
}
|
||||
*dmmap_section = NULL;
|
||||
}
|
||||
|
||||
void get_config_section_of_dmmap_section(char* package, char* section_type, char *section_name, struct uci_section **config_section)
|
||||
{
|
||||
struct uci_section* s;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue