From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796220644; b=TI+PisfUKNaPjRZfnrITKmSN8B8fu+9wg+4V2uKNB6/CdXkAlZy/s2DVvFxCPUL5H0Oj wRE5QAoDWCtqefja8pctPAhoKLkpWZ87WW3Nb4yluiyRcEyWThpRsrzvgz9+1JqD4DCP8 1MX5FtgHiPyGGCLi4QXhAvKsTGnRTYVoeHv93fq5sD3Hrtxa2zGLYihjTBNI316WsY/zs h/J8O8UxUkdvHwIRnFXLIoLtXnYs/e9a9UipZopTo/Re/QkH3/WXVxrc9IvT63oJoBz/7 rcTaXrYfBxZswX1IwkBZ+43r8R1R2QWplRBpklLLpE9wiXcp9yZMdCzVNTBI8MLXUBg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796220644; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=TJj5J0fAhoZ8zmirRbQKknf5LqvPI/Lxnb5liOJWtYI=; b=jbQ4BDw4ywTjrxqnEAXX0mUe1sFLiAzmdDuqWiq08cCp2xYkJx4qlOvjK32XLydaM4oy GGQudV9IDJhVg2A1sZe+RRHh/jeX2ULoRNmACg/tmXgeP7TA6nHrHJWHLrm6egBuoU9Rh ra0ZDEhYH/nOqNH1vCL218cHVYAIZD842Hq1WSNpM0ZvwIOnz7trzB9/lhwEZDEnSUf9n 4Wlsi930RWHu4INY6zdM7Fv99KwQ1dil1Cge20EReAzk0LtU86zQMgMzO4e9d8kekUnSA 40YuSb9FtwFbKG/Drr1aGDg8wDbpw2rYRp4qd0TFn3NomAE3YSQIpDfj/BdqY4uGcSg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Jlg2+rJF; arc=none smtp.remote-ip=209.85.222.51 Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFA9A606A31A for ; Wed, 2 Dec 2026 14:10:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AFA9A606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Jlg2+rJF Received: by mail-ua1-f51.google.com with SMTP id a1e0cc1a2514c-992f6d8cb51so3034027241.3 for ; Wed, 02 Dec 2026 06:10:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796220642; x=1796825442; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=TJj5J0fAhoZ8zmirRbQKknf5LqvPI/Lxnb5liOJWtYI=; b=Jlg2+rJFTrdZncC9aKs+m2foxYTtuBJ0nMYohtmsfz6pahdJwmAfnCJ5TxmEVW4Q79 g9bhZTTkneT3N53OCd/qlz17h1BrFjvB+mwFMJ0l6Hl6pX2LcSZvioUhsR+/oAihqiAf B3SItdG474lanZDrd+KdKxpfQB36vaaRsoR0rrIuH8dqZp6+hObixsgT6lmcQVmaQceF E0nN7VrpVnSafqk7WYhC6RoafsiSN6I5DPyauyAiEw9gXL0JJfHW95qKP39phn+EtCHU jrq+YzfUvanrq3WxAbJ2wym7Ro8MaIQV+0DgmWtLvw4wl7kYU/9htGttuYe9c02LuZBg zGhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796220642; x=1796825442; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=TJj5J0fAhoZ8zmirRbQKknf5LqvPI/Lxnb5liOJWtYI=; b=MnRusWXXfC3/K6z1n4owUVHCVOIkM8cBzOoBh3ER+5tg0IR8fCZDzHDu+3jt2DHVnf elLWe0inIfNcDefvDdkCLXsvTY/yOJtSBPvsxWqLbv49i0+1pPisE2qAV5n5ThmxFVSS Sa/4IU6YShDI0Hw7GBycPfLmcHksDlHSspGz36nWW5EIQsHmVBaPYqf6/L2KzwngGavP 2WVtn75OhTTIbDpjRap9pv9tUwhucOMzwcTrrShNa/D1mvz2Ypkx6DBG6bdW+5u4Tfui JcQUjk/dSVpIvQGaYetO3paDuZr8hCkBqYNaIjWrLP6+kmH87kQ7PQvDqcZ4xI0ZUYii WLtg== X-Forwarded-Encrypted: i=1; AL+hErFr51uN/1Az35/iqm/xTnpbD1axkqmqwA9hGQYEAIbyyu11I9hbsBkLv6ldgUP2pQlP/0PnROmUEvrlA1GleA==@vger.kernel.org X-Gm-Message-State: APuU4Z+C0BfyRGdhYbZeyy1kdDXraA4tXOguoB9O+NuUCG5nbcV/Du8p onwdA5HwfpigqakH/efjNzrrwNKGtbxlvHhXzsnShDliD11/yzbTooY9 X-Gm-Gg: AZFdTZdFQF3xuELHpIMHmIAsnacOwB4f8Uy2PrmKWH6JvMWa4hXGImTqfe7Pru/pg7r 7r0fkxONk4bBYj17HjzjGq2P+EPmI9NRoe7nOHsRIfD3Cs1CAkshf6udMlvo90//PSR8lqymC9k ydIOKxbSby2SETulWcEATC0Rkp/970kgd9FoiJTcc3x1lKKkR3RkGjNXNbdwuyoORpYa0JeR0fw ZUPLG6B3d5+Ufc5AssZg0zAootIXjmBu/fL84nearEhIJLsj9g++/GxQlL57Qw3YXFHtHEHQiCp 4o+1Dp2cXn3tHzObB3ZKYJy2LixKMQJqTuwTYdYcM8kphcEdxp8xcrE5Y43gxr8Van0wO/w1ul4 jWEDIfoS2iGvG5xhvUiCaoqVDUdaD1z8u0tBzdAJXteil1xp6dBz9zP3Irey25jbMo2AFIOqAnu T0VWGFeLrhIB0YVBx9qydYk6fghL9Khe9z0S7W7syPxjb/giX/aKqrgNJEtC0SkhNApLRdN+xLU cIURpO71We19jfw96xqtnfGXLSslu9Gndb5vtHWkBa1lto75nkwsYWlkKg8p5uA1R0PzTu/l1nZ KhTDKwaIkRS9RGzV/9Jb02Euh3//Ysj39YpAgy+FgtbQy1KTGKz63t0nswjfiE4= X-Received: by 2002:a05:6102:6f06:b0:7d2:8e49:f90e with SMTP id ada2fe7eead31-7d7395fe209mr19495371137.27.1796220642386; Wed, 02 Dec 2026 06:10:42 -0800 (PST) Received: from localhost.localdomain ([2600:4041:44c7:5c10:6da5:c2ba:9e4d:8587]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921349b456csm356333676d6.13.2026.12.02.06.10.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 02 Dec 2026 06:10:41 -0800 (PST) From: Christopher Hill To: Johannes Berg Cc: Christopher Hill , linux-wireless@vger.kernel.org, =?UTF-8?q?Miroslav=20R=C3=BDzek?= Subject: [PATCH wireless v2] wifi: mac80211: apply ap_isolate to AP_VLAN stations Date: Wed, 2 Dec 2026 09:09:22 -0500 Message-ID: <20261202140941.16134-1-ch6574@gmail.com> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ap_isolate is set via nl80211 SET_BSS, which is only accepted on AP and P2P GO interfaces, so ieee80211_change_bss() sets IEEE80211_SDATA_DONT_BRIDGE_PACKETS on the AP sdata only. AP_VLAN interfaces never get it, but the intra-BSS forwarding decisions in ieee80211_deliver_skb() and ieee80211_check_fast_rx() test the flag on the station's own sdata, which is the AP_VLAN for stations assigned to a VLAN (e.g. hostapd dynamic_vlan). As a result, mac80211 keeps forwarding frames between stations of the same AP_VLAN although ap_isolate is enabled, and client isolation is silently ineffective for them. Copy the flag from the AP to an AP_VLAN when the AP_VLAN is opened, like the control port settings, and apply a change of ap_isolate to the open AP_VLANs of the AP as well. ieee80211_check_fast_rx_iface() already re-evaluates the fast-rx state of the AP_VLAN stations afterwards. An AP_VLAN that is not open takes the current value when it is opened. Fixes: 7b7b5e56d7bd ("mac80211: implement ap isolation support") Closes: https://lore.kernel.org/linux-wireless/20E87267-920A-4FD9-9443-050AE7676E45@gmail.com/ Signed-off-by: Christopher Hill --- Changes in v2: - Keep IEEE80211_SDATA_DONT_BRIDGE_PACKETS per interface and copy it to the AP_VLANs, instead of moving the setting to struct ieee80211_if_ap and reading it via sdata->bss. The debugfs "flags" file keeps showing the isolation bit, now on AP_VLAN interfaces too. No change for userspace. - Dropped Miroslav's Tested-by from v1, as the code changed. - More idiomatic code style. v1: https://lore.kernel.org/linux-wireless/20261107035220.50480-1-ch6574@gmail.com/ v1 RESEND: https://lore.kernel.org/linux-wireless/20261120235359.3424212-1-miroslav.ryzek@gmail.com/ Tested on a Linksys E8450 (MT7622 + MT7915E, mt76), OpenWrt 25.12.6 with mac80211 from backports 6.18.55 (patch applied with line offsets only), hostapd dynamic_vlan=2 with VLANs from wpa_psk_file, four AP_VLANs per radio, hairpin off on the AP_VLAN bridge ports, two stations on the same radio and AP_VLAN: - ap_isolate=0, with and without multicast_to_unicast=1: debugfs flags AP 0x20, AP_VLANs 0x1; the stations reach each other. - ap_isolate=1 on both radios: AP 0x28, all AP_VLANs 0x9 (before: 0x1); no unicast or multicast replies between the stations, wired hosts still reachable. - ap_isolate changed at runtime on one radio (hostapd_cli SET ap_isolate and UPDATE_BEACON) with the stations associated: that radio's AP_VLANs followed (0x9 -> 0x1) and the stations reached each other again; the other radio's AP_VLANs stayed at 0x9. - No warnings in dmesg. Build-tested on wireless/main (c4328134f) with W=1 (partial build of net/mac80211): cfg.c and iface.c compile without warnings. Not tested: the copy in ieee80211_do_open() on its own (an AP_VLAN opened after ap_isolate was set), mac80211_hwsim, lockdep, 4-addr AP_VLANs, MLO. net/mac80211/cfg.c | 10 ++++++++++ net/mac80211/iface.c | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 9608c07bce..18762c1538 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3706,10 +3706,20 @@ static int ieee80211_change_bss(struct wiphy *wiphy, } if (params->ap_isolate >= 0) { + struct ieee80211_sub_if_data *vlan; + if (params->ap_isolate) sdata->flags |= IEEE80211_SDATA_DONT_BRIDGE_PACKETS; else sdata->flags &= ~IEEE80211_SDATA_DONT_BRIDGE_PACKETS; + + list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) { + if (params->ap_isolate) + vlan->flags |= IEEE80211_SDATA_DONT_BRIDGE_PACKETS; + else + vlan->flags &= ~IEEE80211_SDATA_DONT_BRIDGE_PACKETS; + } + ieee80211_check_fast_rx_iface(sdata); } diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index d0b0a503b2..e8d03a1c16 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1432,6 +1432,11 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) sizeof(sdata->vif.hw_queue)); sdata->vif.bss_conf.chanreq = master->vif.bss_conf.chanreq; + if (master->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) + sdata->flags |= IEEE80211_SDATA_DONT_BRIDGE_PACKETS; + else + sdata->flags &= ~IEEE80211_SDATA_DONT_BRIDGE_PACKETS; + sdata->crypto_tx_tailroom_needed_cnt += master->crypto_tx_tailroom_needed_cnt; -- 2.50.1