diff options
author | Bob Copeland <me@bobcopeland.com> | 2014-06-28 16:35:26 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-08-26 05:15:34 -0400 |
commit | f8134fed8346c05007ca23e22e1504097afcd7c9 (patch) | |
tree | febbf284daf32f2c4df82b5784125ac76db624f4 /net/mac80211/mesh_plink.c | |
parent | 53b954ee4a71e782d7dfcdeee5bf4695caeeb112 (diff) |
mac80211: mesh_plink: use get_unaligned_le16 instead of memcpy
Use get_unaligned_le16 to access llid/plid.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mesh_plink.c')
-rw-r--r-- | net/mac80211/mesh_plink.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 8d67c1ebfbda..8f0887fc7128 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -1001,7 +1001,6 @@ mesh_process_plink_frame(struct ieee80211_sub_if_data *sdata, | |||
1001 | enum ieee80211_self_protected_actioncode ftype; | 1001 | enum ieee80211_self_protected_actioncode ftype; |
1002 | u32 changed = 0; | 1002 | u32 changed = 0; |
1003 | u8 ie_len = elems->peering_len; | 1003 | u8 ie_len = elems->peering_len; |
1004 | __le16 _plid, _llid; | ||
1005 | u16 plid, llid = 0; | 1004 | u16 plid, llid = 0; |
1006 | 1005 | ||
1007 | if (!elems->peering) { | 1006 | if (!elems->peering) { |
@@ -1036,13 +1035,10 @@ mesh_process_plink_frame(struct ieee80211_sub_if_data *sdata, | |||
1036 | /* Note the lines below are correct, the llid in the frame is the plid | 1035 | /* Note the lines below are correct, the llid in the frame is the plid |
1037 | * from the point of view of this host. | 1036 | * from the point of view of this host. |
1038 | */ | 1037 | */ |
1039 | memcpy(&_plid, PLINK_GET_LLID(elems->peering), sizeof(__le16)); | 1038 | plid = get_unaligned_le16(PLINK_GET_LLID(elems->peering)); |
1040 | plid = le16_to_cpu(_plid); | ||
1041 | if (ftype == WLAN_SP_MESH_PEERING_CONFIRM || | 1039 | if (ftype == WLAN_SP_MESH_PEERING_CONFIRM || |
1042 | (ftype == WLAN_SP_MESH_PEERING_CLOSE && ie_len == 8)) { | 1040 | (ftype == WLAN_SP_MESH_PEERING_CLOSE && ie_len == 8)) |
1043 | memcpy(&_llid, PLINK_GET_PLID(elems->peering), sizeof(__le16)); | 1041 | llid = get_unaligned_le16(PLINK_GET_PLID(elems->peering)); |
1044 | llid = le16_to_cpu(_llid); | ||
1045 | } | ||
1046 | 1042 | ||
1047 | /* WARNING: Only for sta pointer, is dropped & re-acquired */ | 1043 | /* WARNING: Only for sta pointer, is dropped & re-acquired */ |
1048 | rcu_read_lock(); | 1044 | rcu_read_lock(); |