Merge pull request #51 from chunyeow/master
authorAdrian Chadd <adrian.chadd@gmail.com>
Fri, 4 Apr 2014 10:38:45 +0000 (03:38 -0700)
committerAdrian Chadd <adrian.chadd@gmail.com>
Fri, 4 Apr 2014 10:38:45 +0000 (03:38 -0700)
ath9k_htc_firmware: fix the offset of CCMP header for mesh data frame

target_firmware/wlan/ieee80211_output.c

index ce034edf35cf9d58255ec5a297e8f6fe98928c4b..3d687043405ece246a80fd14bfe8bccaef2a26ff 100755 (executable)
@@ -67,10 +67,16 @@ ieee80211_tgt_crypto_encap(struct ieee80211_frame *wh,
        a_uint16_t tmp;
        a_uint16_t offset = IEEE80211_WLAN_HDR_LEN;
        a_uint8_t b1, b2;
+       struct ieee80211_qosframe_addr4 *wh_mesh;
 
        if (IEEE80211_QOS_HAS_SEQ(wh))
                offset += 4;  // pad for 4 byte alignment
 
+       /* set the offset to 32 if the mesh control field is present */
+       wh_mesh = (struct ieee80211_qosframe_addr4 *)wh;
+       if (wh_mesh->i_qos[1] == 0x01)
+               offset = 32;
+
        iv = (a_uint8_t *) wh;
        iv = iv + offset;