mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Ticket refs #5928: Change macvlan to vlanid in VLANTermination doesn't work
This commit is contained in:
parent
82bba0a58c
commit
7f8398bec4
1 changed files with 25 additions and 0 deletions
25
dmtree/vendor/iopsys/tr181/ethernet.c
vendored
25
dmtree/vendor/iopsys/tr181/ethernet.c
vendored
|
|
@ -106,6 +106,31 @@ static int set_EthernetVLANTermination_MACVLAN(char *refparam, struct dmctx *ctx
|
|||
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "name", new_name);
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "type", "macvlan");
|
||||
} else if (!b && *name != '\0') {
|
||||
char *vid = NULL, new_name[16] = {0};
|
||||
|
||||
uci_foreach_option_eq("network", "interface", "device", name, s) {
|
||||
|
||||
get_dmmap_section_of_config_section_eq("dmmap", "link", "device", name, &dmmap_s);
|
||||
if (dmmap_s) {
|
||||
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "vid", &vid);
|
||||
if (vid && *vid)
|
||||
snprintf(new_name, sizeof(new_name), "%s.%s", ifname, vid);
|
||||
else
|
||||
snprintf(new_name, sizeof(new_name), "%s", ifname);
|
||||
|
||||
if (ethernet_name_exists_in_devices(new_name))
|
||||
return -1;
|
||||
|
||||
dmuci_set_value_by_section(dmmap_s, "device", ifname);
|
||||
}
|
||||
|
||||
dmuci_set_value_by_section(s, "device", new_name);
|
||||
break;
|
||||
}
|
||||
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "name", new_name);
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "type", "8021q");
|
||||
} else {
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "type", b ? "macvlan" : "8021q");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue