mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-01-28 01:47:18 +01:00
Updated the logic to identify macvlan device
This commit is contained in:
parent
69b702e57c
commit
25a5df6b98
1 changed files with 22 additions and 3 deletions
|
|
@ -100,6 +100,23 @@ bool ethernet___name_exists_in_devices(char *name)
|
|||
return false;
|
||||
}
|
||||
|
||||
static bool is_mac_vlan_interface(char *device_name)
|
||||
{
|
||||
struct uci_section *s = NULL;
|
||||
char *type = NULL, *name = NULL;
|
||||
|
||||
uci_foreach_sections("network", "device", s) {
|
||||
|
||||
dmuci_get_value_by_section_string(s, "type", &type);
|
||||
dmuci_get_value_by_section_string(s, "name", &name);
|
||||
|
||||
if (DM_STRCMP(type, "macvlan") == 0 && DM_STRCMP(name, device_name) == 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void add_ethernet_link_section(char *device, char *macaddr)
|
||||
{
|
||||
struct uci_section *dmmap_s = NULL;
|
||||
|
|
@ -148,9 +165,11 @@ static void dmmap_synchronizeEthernetLink(struct dmctx *dmctx, DMNODE *parent_no
|
|||
if (has_vid)
|
||||
*has_vid = '\0';
|
||||
|
||||
char *is_mac_vlan = DM_STRCHR(dev_name, '_');
|
||||
if (is_mac_vlan)
|
||||
*is_mac_vlan = '\0';
|
||||
if (is_mac_vlan_interface(dev_name)) {
|
||||
char *p = DM_STRCHR(dev_name, '_');
|
||||
if (p)
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
if (is_ethernet_link_exist(dev_name))
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue