Re: [PATCH 3/3] wifi: cfg80211: check if AP has been started before adding new station

From: Johannes Berg

Date: Tue Sep 08 2026 - 10:23:10 EST


On Tue, 2026-09-08 at 15:35 +0200, Slawomir Stepien wrote:
> > But it's another messy code path - if you have AP A and B, and VLANs A'
> > and B' belonging to A and B respectively, then you can
> >
> > add_station(A, vlan=B')
> >
> > and it gets added on B/B', and B must be IFF_UP (because B' must be
> > IFF_UP) but doesn't need to be beaconing and we're back to the bug, it
> > seems? Maybe I'm missing something.
>
> You can't add a vlan interface that dosn't have correct "parent" wiphy, get_vlan() checks that
> already:
>
> v = dev_get_by_index(genl_info_net(info), nla_get_u32(vlanattr));
> if (!v)
> return ERR_PTR(-ENODEV);
>
> if (!v->ieee80211_ptr || v->ieee80211_ptr->wiphy != &rdev->wiphy) {

Sure, but that just means that A and B have to be on the same wiphy.

> This check I've pasted should be good enough, right?

Don't think so? You can have A, B, A' and B' all on the same wiphy.

johannes