From 02ed19e3ac43926dfe1900a864b9876e33e1837b Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 9 Oct 2025 12:04:47 +0200 Subject: [PATCH] ucentral-event: fix VLAN bridge membership during FT roaming During 802.11r Fast Transition roaming, when a client moves between APs (e.g., wlan0 to wlan1) with the same dynamic VLAN assignment, the vlan_add handler's refcount mechanism prevented the new WiFi interface from being added to the bridge. When wlan0-v100 and wlan1-v100 exist simultaneously with VLAN ID 100, the refcount becomes 2, causing vlan_add to exit early for wlan1-v100. This left wlan1-v100 out of the bridge VLAN table, breaking connectivity after roaming despite correct VLAN assignment via RADIUS and RRB frames. Fix by detecting WiFi VLAN interfaces (wlan*-v*) and always adding them to the bridge regardless of refcount. The refcount mechanism now only controls WAN port VLAN configuration, which should only occur once per VLAN ID. Also reorganise vlan_add/vlan_remove to check swconfig early for clarity. Signed-off-by: John Crispin --- .../ucentral-event/files/ucentral-event | 40 ++++++++++--------- feeds/ucentral/ucentral-schema/Makefile | 5 +-- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/feeds/ucentral/ucentral-event/files/ucentral-event b/feeds/ucentral/ucentral-event/files/ucentral-event index 54fb8f67b..601211daa 100755 --- a/feeds/ucentral/ucentral-event/files/ucentral-event +++ b/feeds/ucentral/ucentral-event/files/ucentral-event @@ -275,23 +275,27 @@ handlers = { }, vlan_add: function(notify) { - let vlan_id = `${notify.data.vlan_id}`; - vlan_refcount[vlan_id] = (vlan_refcount[vlan_id] || 0) + 1; - - if (vlan_refcount[vlan_id] > 1) { - return; - } - if (config.config.swconfig) return handlers.vlan_add_swconfig(notify); - for (let wan in wan_ports) { - let msg = { - name: wan, - vlan: [ `${notify.data.vlan_id}:t` ] - }; - ubus.call('network.interface.up_none', 'add_device', msg); - ubus.call('udevstats', 'add_device', { device: wan, vlan: +notify.data.vlan_id }); + let vlan_id = `${notify.data.vlan_id}`; + vlan_refcount[vlan_id] = (vlan_refcount[vlan_id] || 0) + 1; + + let parts = split(notify.data.ifname, '-v'); + let is_wifi_iface = (length(parts) == 2 && wildcard(parts[0], 'wlan*')); + + if (vlan_refcount[vlan_id] > 1 && !is_wifi_iface) + return; + + if (vlan_refcount[vlan_id] == 1) { + for (let wan in wan_ports) { + let msg = { + name: wan, + vlan: [ `${notify.data.vlan_id}:t` ] + }; + ubus.call('network.interface.up_none', 'add_device', msg); + ubus.call('udevstats', 'add_device', { device: wan, vlan: +notify.data.vlan_id }); + } } let msg = { @@ -304,16 +308,16 @@ handlers = { }, vlan_remove: function(notify) { + if (config.config.swconfig) + return; + let vlan_id = `${notify.data.vlan_id}`; vlan_refcount[vlan_id] = (vlan_refcount[vlan_id] || 1) - 1; - if (vlan_refcount[vlan_id] > 0) { + if (vlan_refcount[vlan_id] > 0) return; - } delete vlan_refcount[vlan_id]; - if (config.config.swconfig) - return; for (let wan in wan_ports) { let msg = { name: wan, diff --git a/feeds/ucentral/ucentral-schema/Makefile b/feeds/ucentral/ucentral-schema/Makefile index e543f32cc..c32c7ccad 100644 --- a/feeds/ucentral/ucentral-schema/Makefile +++ b/feeds/ucentral/ucentral-schema/Makefile @@ -4,10 +4,9 @@ PKG_NAME:=ucentral-schema PKG_RELEASE:=1 PKG_SOURCE_URL=https://github.com/Telecominfraproject/wlan-ucentral-schema.git -PKG_MIRROR_HASH:=83c6f6ae9898086f12cf6b3d611019ad024b1581533bdff1838180d3777ef7e1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2025-09-29 -PKG_SOURCE_VERSION:=c7e15eb3406db6015fc3e9a86c116695552bb12b +PKG_SOURCE_DATE:=2025-10-09 +PKG_SOURCE_VERSION:=c836eb5cf446e7b2f8657b57b0518b83b0699411 PKG_MAINTAINER:=John Crispin PKG_LICENSE:=BSD-3-Clause