Date: Sat, 11 Feb 2012 21:33:45 -0800 From: Adrian Chadd <adrian@freebsd.org> To: freebsd-wireless@freebsd.org Subject: [ath] patch: lock vap->iv_bss before using it in a few places Message-ID: <CAJ-Vmo=0u2_U_mY-QnPYo20MqK_ob6qiTRHTi3ruBFgW6=f0sA@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
--00504502d75d9f48de04b8bdb4b5 Content-Type: text/plain; charset=ISO-8859-1 Hi all, This quick patch mirrors what was done in r212127 - it enforces locking of whatever the vap->iv_bss node is before using it. I'd appreciate some testing and feedback before I commit it. I'm going to try and reproduce breaking it in sta/hostap mode but I won't be able to until I'm back in the lab next week. Thanks, Adrian --00504502d75d9f48de04b8bdb4b5 Content-Type: application/octet-stream; name="if_ath_net80211_lock.diff" Content-Disposition: attachment; filename="if_ath_net80211_lock.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gyjn1fcp0 SW5kZXg6IHN5cy9kZXYvYXRoL2lmX2F0aC5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9kZXYvYXRoL2lm X2F0aC5jCShyZXZpc2lvbiAyMzE1NDEpCisrKyBzeXMvZGV2L2F0aC9pZl9hdGguYwkod29ya2lu ZyBjb3B5KQpAQCAtMTY2OSw2ICsxNjY5LDcgQEAKIAkJc3RydWN0IGF0aF9zb2Z0YyAqc2MgPSBp ZnAtPmlmX3NvZnRjOwogCQl1X2ludDY0X3QgbGFzdHJ4ID0gc2MtPnNjX2xhc3RyeDsKIAkJdV9p bnQ2NF90IHRzZiA9IGF0aF9oYWxfZ2V0dHNmNjQoc2MtPnNjX2FoKTsKKwkJLyogWFhYIHNob3Vs ZCB0YWtlIGEgbG9ja2VkIHJlZiB0byBpdl9ic3MgKi8KIAkJdV9pbnQgYm1pc3N0aW1lb3V0ID0K IAkJCXZhcC0+aXZfYm1pc3N0aHJlc2hvbGQgKiB2YXAtPml2X2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