Search Linux Wireless

Re: [PATCH 01/13 v2] o11s: (nl80211/cfg80211) support for mesh interfaces and mesh paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > +	int	(*dump_station)(struct wiphy *wiphy, struct net_device *dev,
> > +			       int idx, u8 *mac, struct station_info *sinfo);
> 
> How do you use this? I can see that the "idx" is used to iterate, but
> this cannot possibly provide race-free access because the implementation
> in mac80211's cfg.c needs to give up the lock. I think we need to change
> this to
> 
> int (*dump_stations)(wiphy, dev,
> 		     void (*callback)(wiphy, dev, data, mac, sinfo),
> 		     void *data);
> 
> The same seems to apply to nl80211_dump_mpath() and the corresponding
> callback.
> 
> An alternative would be to provide start_station_dump() and
> stop_station_dump() callbacks for the locking, or, something I wouldn't
> really like to see, document the interface to lock when idx == 0 and
> unlock when the return value is -ENOENT or something...

Ok, I changed my mind, it has to be with conditional locking even for
the RTNL because .dumpit callbacks can be invoked multiple times for a
single dump operation and need to keep all locks (even the rtnl) across
the calls.

Can you do that in both nl80211 and mac80211 for both STAs and paths?
Look at net/netlink/genetlink.c ctrl_dumpfamily() for an example.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux