From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antonio Quartulli Date: Sun, 17 Nov 2013 12:08:02 +0100 Subject: [ath9k-devel] GTK/PTK problem - key.c magic-bitshift Message-ID: <20131117110802.GD1381@neomailbox.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org Hello list, I am debugging a strange problem which symptom is that the PTK of some station is messed up right after hostapd has configured a new GTK. This happens both in WPA2 only and WPA/WPA2 mixed mode. I have no real clue of what is going on and so, after having given a look at the hostapd code, I am now checking the driver (Ath9k). While digging I found a piece of code in key.c which I can't understand. Here is the snippet: 111 macLo = get_unaligned_le32(mac); 112 macHi = get_unaligned_le16(mac + 4); 113 macLo >>= 1; 114 macLo |= (macHi & 1) << 31; 115 macHi >>= 1; At drivers/net/wireless/ath/key.c:113 there is a right-bitshift operation executed on macLo. Since macLo is a 4byte variable containing 4 out of 6 bytes of the MAC address passed as argument, it looks to me like the bitshift is throwing away one bit that we will never recover. I don't want to claim that this is necessarily connected to the problem I am experiencing, but I'd like to get a better understanding of this part in order to continue my research. However the driver I am using is not the latest one, so if somebody knows whether this GTK/PTK problem is known and fixed I would be glad if you could tell me :-) Thanks a lot for your time. Regards, -- Antonio Quartulli -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20131117/ec3e92b1/attachment.pgp