Skip to content
Snippets Groups Projects
Commit 0166e859 authored by Markus Gothe's avatar Markus Gothe :ok_hand: Committed by Erik Karlsson
Browse files

netifd: refine 100-add-support-for-ecnt-lan-device.patch

Refine the patch to correctly deal with tagged VLANs on the LAN ports.

(cherry picked from commit 7c9376c2)
parent acf80b87
Branches release-7.4
No related tags found
1 merge request!712netifd: refine 100-add-support-for-ecnt-lan-device.patch
diff --git a/device.c b/device.c diff -uNr a/vlan.c b/vlan.c
index d69be9c..2798555 100644 --- a/vlan.c 2024-01-04 13:35:43.000000000 +0100
--- a/device.c +++ b/vlan.c 2025-04-23 23:01:10.763035748 +0200
+++ b/device.c @@ -260,7 +260,7 @@
@@ -696,6 +696,18 @@ device_find(const char *name) if (!buf)
return avl_find_element(&devices, name, dev, avl); return NULL;
}
- s = split_vlan(buf);
+static bool + s = split_vlan(strncmp(buf, "eth0.", 5) ? buf : buf + 5);
+device_is_lan_port(const char *name) dev = __device_get(buf, create, false);
+{ if (!dev || !s)
+ int i; goto out;
+ int n;
+
+ if (sscanf(name, "eth0.%d %n", &i, &n) == 1 && !name[n])
+ return true;
+
+ return false;
+}
+
struct device *
__device_get(const char *name, int create, bool check_vlan)
{
@@ -703,7 +715,7 @@ __device_get(const char *name, int create, bool check_vlan)
dev = avl_find_element(&devices, name, dev, avl);
- if (!dev && check_vlan && strchr(name, '.'))
+ if (!dev && check_vlan && !device_is_lan_port(name) && strchr(name, '.'))
return get_vlan_device_chain(name, create);
if (name[0] == '@')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment