<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi John,<div><br></div><div>ok, my issue: <a href="https://bugs.openwrt.org/index.php?do=details&task_id=2698">https://bugs.openwrt.org/index.php?do=details&task_id=2698</a></div><div><br></div><div>Details:</div><div><br></div><div>When virtual access points are used (multiple BSSIDS on one physical interface), only the first BSSID is assigned to an existing network interface, all other access point's (BSSIDs) network interfaces are created by hostapd. The original <span style="color:rgb(36,41,46);font-size:11.9px;background-color:rgba(27,31,35,0.05)"><font face="monospace">mac80211.sh</font></span> script tries to call <span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;font-size:11.9px;background-color:rgba(27,31,35,0.05)">ip link set dev <iface> up</span> on all interfaces, even on virtual ones, and it tries to set <font face="monospace">txpower</font> too. This works as long as the interface exists prior to trying to setting it up - when hostapd has enough time to create them. The script uses <font face="monospace">sleep 1</font> most probably to give hostapd time to create the interfaces. But when the creation of interfaces is delayed for any reason, like is for DFS on 5GHz band, the interface is created after one minute (i.e. it takes 60 seconds to create virtual interfaces). The DFS on 5GHz works in a way that the driver scans for any possible radar transmitting on the frequency and if it does not find any within a minute, the frequency is allowed to be used. In this case the setting-up (<font face="monospace">ip link set dev <iface> up</font>) of the interface fails (the interface does not exist yet) and <font face="monospace">wireless_add_vif</font> is not called. My patch ensures that the <font face="monospace">wireless_add_vif</font> is called also for virtual interfaces - those created by hostapd.</div><div><br></div><div>Regards,</div><div>Oldrich.</div><div><br></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">út 24. 3. 2020 v 15:05 odesílatel John Crispin <<a href="mailto:john@phrozen.org">john@phrozen.org</a>> napsal:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
what do you setup a device fully managed by hostapd ? I am not sure i <br>
understand what that is. Best if you explain your problem so i can try <br>
to reproduce and fix it.<br>
<br>
to answer your question, in a multi vap setup "wifi reconf" will break <br>
with your change as it breaks the symmetry of link up/down calls<br>
<br>
John<br>
<br>
On 24.03.20 14:55, Oldřich Jedlička wrote:<br>
> Hi John,<br>
> <br>
> Are you able to describe what exactly does not work - how to reproduce <br>
> it? Maybe it is simple and obvious to you, but please describe what does <br>
> not work.<br>
> <br>
> I just removed setting interface up and setting txpower on it - when the <br>
> interface is fully managed by hostapd. That looks reasonable to me, but <br>
> might be wrong as well. At least it made reporting of the interface <br>
> status working, see <a href="https://github.com/openwrt/openwrt/pull/2848" rel="noreferrer" target="_blank">https://github.com/openwrt/openwrt/pull/2848</a> for <br>
> screen-shots.<br>
> <br>
> Regards,<br>
> Oldrich.<br>
> <br>
> <br>
> <br>
> út 24. 3. 2020 v 12:10 odesílatel John Crispin <<a href="mailto:john@phrozen.org" target="_blank">john@phrozen.org</a> <br>
> <mailto:<a href="mailto:john@phrozen.org" target="_blank">john@phrozen.org</a>>> napsal:<br>
> <br>
> Hi<br>
> below commit breaks wifi reconf feature and to be honest it looks like<br>
> the wrong fix to me.<br>
> John<br>
> <br>
> <br>
> > dangole pushed a commit to openwrt/openwrt.git, branch master:<br>
> > <a href="https://git.openwrt.org/23a885bf89a204f91e4f17ed96f1a9fc7f50ea34" rel="noreferrer" target="_blank">https://git.openwrt.org/23a885bf89a204f91e4f17ed96f1a9fc7f50ea34</a><br>
> ><br>
> > commit 23a885bf89a204f91e4f17ed96f1a9fc7f50ea34<br>
> > Author: Oldřich Jedlička <<a href="mailto:oldium.pro@gmail.com" target="_blank">oldium.pro@gmail.com</a><br>
> <mailto:<a href="mailto:oldium.pro@gmail.com" target="_blank">oldium.pro@gmail.com</a>>><br>
> > AuthorDate: Mon Mar 16 21:00:51 2020 +0100<br>
> ><br>
> > mac80211: do not try to setup hostapd-managed interfaces.<br>
> ><br>
> > For virtual access points (when multiple SSIDs are used for one<br>
> > physical AP), there exist one physical network interface and<br>
> > multiple virtual interfaces, which are fully under control of<br>
> > hostapd. When networking is setup, the script<br>
> > `/lib/netifd/wireless/mac80211.sh` is called, which tries to<br>
> bring<br>
> > the interface up by a call to `ip link set dev <iface> up`. This<br>
> > call might fail for virtual APs, because the virtual interface<br>
> > might not have been created by hostapd yet. There are some<br>
> artifical<br>
> > delays in the script most probably to handle this, but when DFS<br>
> > channel availability check on 5GHz band is issued, hostapd can<br>
> > delay creating virtual interfaces by a minute.<br>
> ><br>
> > In order to fix this (or work around it), do not try to<br>
> bring the<br>
> > interface up (this is responsibility of hostapd anyway) and<br>
> > do not try to set txpower on the virtual interface.<br>
> ><br>
> > Fixes FS#2698.<br>
> ><br>
> > Signed-off-by: Oldřich Jedlička <<a href="mailto:oldium.pro@gmail.com" target="_blank">oldium.pro@gmail.com</a><br>
> <mailto:<a href="mailto:oldium.pro@gmail.com" target="_blank">oldium.pro@gmail.com</a>>><br>
> > ---<br>
> > .../mac80211/files/lib/netifd/wireless/mac80211.sh | 18<br>
> +++++++++++-------<br>
> > 1 file changed, 11 insertions(+), 7 deletions(-)<br>
> ><br>
> > diff --git<br>
> a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh<br>
> b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh<br>
> > index f22730c9fc..f59c498215 100644<br>
> > --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh<br>
> > +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh<br>
> > @@ -533,6 +533,7 @@ mac80211_prepare_vif() {<br>
> ><br>
> > NEWAPLIST="${NEWAPLIST}$ifname "<br>
> > [ -n "$hostapd_ctrl" ] || {<br>
> > + ap_ifname="${ifname}"<br>
> > <br>
> hostapd_ctrl="${hostapd_ctrl:-/var/run/hostapd/$ifname}"<br>
> > }<br>
> > ;;<br>
> > @@ -753,13 +754,15 @@ mac80211_setup_vif() {<br>
> > json_get_var vif_enable enable 1<br>
> ><br>
> > [ "$vif_enable" = 1 ] || action=down<br>
> > - logger ip link set dev "$ifname" $action<br>
> > - ip link set dev "$ifname" "$action" || {<br>
> > - wireless_setup_vif_failed IFUP_ERROR<br>
> > - json_select ..<br>
> > - return<br>
> > - }<br>
> > - [ -z "$vif_txpower" ] || iw dev "$ifname" set txpower fixed<br>
> "${vif_txpower%%.*}00"<br>
> > + if [ "$mode" != "ap" ] || [ "$ifname" = "$ap_ifname" ]; then<br>
> > + logger ip link set dev "$ifname" $action<br>
> > + ip link set dev "$ifname" "$action" || {<br>
> > + wireless_setup_vif_failed IFUP_ERROR<br>
> > + json_select ..<br>
> > + return<br>
> > + }<br>
> > + [ -z "$vif_txpower" ] || iw dev "$ifname" set<br>
> txpower fixed "${vif_txpower%%.*}00"<br>
> > + fi<br>
> ><br>
> > case "$mode" in<br>
> > mesh)<br>
> > @@ -924,6 +927,7 @@ drv_mac80211_setup() {<br>
> ><br>
> > has_ap=<br>
> > hostapd_ctrl=<br>
> > + ap_ifname=<br>
> > hostapd_noscan=<br>
> > for_each_interface "ap" mac80211_check_ap<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > lede-commits mailing list<br>
> > <a href="mailto:lede-commits@lists.infradead.org" target="_blank">lede-commits@lists.infradead.org</a><br>
> <mailto:<a href="mailto:lede-commits@lists.infradead.org" target="_blank">lede-commits@lists.infradead.org</a>><br>
> > <a href="http://lists.infradead.org/mailman/listinfo/lede-commits" rel="noreferrer" target="_blank">http://lists.infradead.org/mailman/listinfo/lede-commits</a><br>
> ><br>
> <br>
> <br>
> _______________________________________________<br>
> openwrt-devel mailing list<br>
> <a href="mailto:openwrt-devel@lists.openwrt.org" target="_blank">openwrt-devel@lists.openwrt.org</a><br>
> <a href="https://lists.openwrt.org/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/mailman/listinfo/openwrt-devel</a><br>
> <br>
<br>
</blockquote></div>