On Mon, 2014-03-24 at 18:35 +0100, Arend van Spriel wrote: > > To avoid this problem, introduce an ownership concept for interfaces. If > > an interface is owned by a netlink socket, then it will be destroyed if > > the netlink socket is closed for any reason, including if the process it > > belongs to crashed. This gives us a race-free way to get rid of any such > > interfaces. > > Excellent idea. :) > > + * @NL80211_ATTR_IFACE_SOCKET_OWNER: flag attribute, if set during interface > > + * creation then the new interface will be owned by the netlink socket > > + * that created it and will be destroyed when the socket is closed > > + * > > Guess you want explicit flag so apps like iw can still create > interfaces, right? Right, otherwise iw exits and the interface is destroyed immediately (I did that for my testcase :) ) > > @@ -11662,6 +11675,19 @@ static int nl80211_netlink_notify(struct notifier_block * nb, > > } > > } > > spin_unlock_bh(&rdev->beacon_registrations_lock); > > + > > + if (schedule_destroy_work) { > > + struct cfg80211_iface_destroy *destroy; > > + > > + destroy = kzalloc(sizeof(*destroy), GFP_ATOMIC); > > Probably overlooking it, because it is not part of the patch but: what > lock requires this to be atomic? rcu_read_lock? yes, but even if we moved it out it wouldn't help since it's an atomic notifier chain johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html