Skip to contentSkip to conversation

warning in ieee80211 tkip code

DISCUSSION Johannes Berg 1 participant 2 messages Aug 13, 2007 – Oct 10, 2007

lore
Share & tools
lore
#0 lore raw

net/ieee80211/ieee80211_crypt_tkip.c: In function 'michael_mic_hdr':
net/ieee80211/ieee80211_crypt_tkip.c:587: warning: overflow in implicit constant conversion

The reason is pretty obvious:
hdr[12] = qoshdr->qos_ctl & cpu_to_le16(IEEE80211_QCTL_TID);

where IEEE80211_QCTL_TID is 0xF, so that's made into 0xF00 on BE and then truncated to 0x00. Not very useful.

This was introduced in this commit:

commit 65b6a2775102cd81e57158ef4b1cb89641f76cfd

Author: Zhu Yi <[email protected]>
Date:   Mon Aug 21 11:32:31 2006 +0800

with the change

- hdr[12] = le16_to_cpu(qoshdr->qos_ctl) & IEEE80211_QCTL_TID;
+ hdr[12] = qoshdr->qos_ctl & cpu_to_le16(IEEE80211_QCTL_TID);

The code before the change looks much saner since you're accessing the header as bytes...

johannes

#1 lore raw
Quoted 7 lines · Johannes Berg

net/ieee80211/ieee80211_crypt_tkip.c: In function 'michael_mic_hdr':
net/ieee80211/ieee80211_crypt_tkip.c:587: warning: overflow in implicit constant conversion

The reason is pretty obvious:
hdr[12] = qoshdr->qos_ctl & cpu_to_le16(IEEE80211_QCTL_TID);

Quoted 8 lines

where IEEE80211_QCTL_TID is 0xF, so that's made into 0xF00 on BE and then truncated to 0x00. Not very useful.

This was introduced in this commit:

commit 65b6a2775102cd81e57158ef4b1cb89641f76cfd

Author: Zhu Yi <[email protected]>
Date:   Mon Aug 21 11:32:31 2006 +0800

Ping? Any comments on this? It's been two months.

johannes