[PATCH] wpa_supplicant: multi_ap: only enable 4addr mode if not already enabled

Johannes Berg johannes at sipsolutions.net
Fri Feb 12 04:22:17 EST 2021


On Wed, 2021-02-10 at 12:37 +0100, Janusz Dziedzic wrote:

> > > Did fast patch (didn't check code deeply yet - just check set 4addr
> > > when busy issuey, seems works correctly):
> > > diff --git a/net/wireless/util.c b/net/wireless/util.c
> > > @@ -1027,6 +1027,7 @@ int cfg80211_change_iface(struct
> > > cfg80211_registered_device *rdev,
> > > 
> > >         /* if it's part of a bridge, reject changing type to station/ibss */
> > >         if (netif_is_bridge_port(dev) &&
> > > +           (ntype != otype) &&
> > >             (ntype == NL80211_IFTYPE_ADHOC ||
> > >              ntype == NL80211_IFTYPE_STATION ||
> > >              ntype == NL80211_IFTYPE_P2P_CLIENT))
> > 
> > How would that prevent disabling of 4addr mode when the netdev is in a
> > bridge?
> > 
> This what I have with cfg80211 patch included:
> root at t2:~# brctl addif br0 wlp1s0
> root at t2:~# iw wlp1s0 set 4addr on
> root at t2:~# brctl show
> bridge name bridge id STP enabled interfaces
> br0 8000.68942328a725 no wlp1s0
> 
> root at t2:~# iw wlp1s0 set 4addr off
> command failed: Device or resource busy (-16)
> root at t2:~# iw wlp1s0 set 4addr on
> root at t2:~# iw wlp1s0 set 4addr on
> 
> Seems there is another check in cfg80211 that already handle this.

It's a different code path to set 4addr on/off in this function, so this
is not really a surprise?

Anyway, from a code POV this seems OK, though I'd prefer moving the
bridge port check into the existing "ntype != otype" if there.

johannes




More information about the Hostap mailing list