From owner-freebsd-wireless@FreeBSD.ORG Sun Feb 12 05:33:46 2012 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9E5E106566B for ; Sun, 12 Feb 2012 05:33:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6A4218FC08 for ; Sun, 12 Feb 2012 05:33:46 +0000 (UTC) Received: by werm13 with SMTP id m13so4334768wer.13 for ; Sat, 11 Feb 2012 21:33:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=BafZEcKWL0HLFq4300qHaJaFdu/GNRul00Jvfaftl7E=; b=vjpcf3Lh6TJLzLdZ3EAF4PGRbQSdZfQ8vetMTHmkmQ7BoGBSl/K8o1wsdTDh7MKZlb J00I/TKfUfvjeDO8ANOoXxdcuxKwrVpCUQ252eFrjggkg+quzDoYg4+kK8eNrixCneeo Amg48TSFKtqQdulNmtT8polOColeeHbNAVtSY= MIME-Version: 1.0 Received: by 10.216.135.76 with SMTP id t54mr4629834wei.14.1329024825509; Sat, 11 Feb 2012 21:33:45 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.175.136 with HTTP; Sat, 11 Feb 2012 21:33:45 -0800 (PST) Date: Sat, 11 Feb 2012 21:33:45 -0800 X-Google-Sender-Auth: dQ3S6mkiIlj95rCS3Fc6Rnh4zMA Message-ID: From: Adrian Chadd To: freebsd-wireless@freebsd.org Content-Type: multipart/mixed; boundary=00504502d75d9f48de04b8bdb4b5 Subject: [ath] patch: lock vap->iv_bss before using it in a few places X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 05:33:46 -0000 --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+aXZfYm1pc3N0aHJlc2hvbGQgKiB2YXAtPml2X2Jzcy0+bmlfaW50dmFsICogMTAy NDsKIApAQCAtMzI0NSw3ICszMjQ2LDcgQEAKIAogCWlmICh2YXAgPT0gTlVMTCkKIAkJdmFwID0g VEFJTFFfRkl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