On Sun, Jan 12, 2020 at 09:39:19PM +0100, Peter Hessler wrote: > When we change attributes for a join essid, we should apply the change > immediately instead of waiting to (randomly) switch away and switch > back. > > Found by martijn@ > > OK? > > Index: net80211/ieee80211_ioctl.c > =================================================================== > RCS file: /home/cvs/openbsd/src/sys/net80211/ieee80211_ioctl.c,v > retrieving revision 1.77 > diff -u -p -u -p -r1.77 ieee80211_ioctl.c > --- net80211/ieee80211_ioctl.c 11 Nov 2019 18:07:21 -0000 1.77 > +++ net80211/ieee80211_ioctl.c 12 Jan 2020 18:38:44 -0000 > @@ -540,6 +540,17 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon > error = ENETRESET; > } > } else { > + /* > + * We are reconfiguring the active essid,
Perhaps say "If we are reconfiguring..., reset the interface." instead? Whether we're reconfiguring depends on the result of the check you're adding below, while the comment makes it sound as if this decision had been made further up. Alternatively we could just remove the comment. > + * so reset the interface. > + */ > + if (ic->ic_des_esslen == join.i_len && > + memcmp(join.i_nwid, ic->ic_des_essid, > + join.i_len) == 0) { > + ieee80211_deselect_ess(ic); > + error = ENETRESET; > + } > + > /* save nwid for auto-join */ > if (ieee80211_add_ess(ic, &join) == 0) > ic->ic_flags |= IEEE80211_F_AUTO_JOIN; >