From: Bob Copeland <me@bobcopeland.com>
To: johannes@sipsolutions.net
Cc: devel@lists.open80211s.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] mac80211: mesh_plink: use get_unaligned_le16 instead of memcpy
Date: Sat, 28 Jun 2014 16:54:52 -0400 [thread overview]
Message-ID: <20140628205452.GB17825@localhost> (raw)
In-Reply-To: <1403987726-17576-2-git-send-email-me@bobcopeland.com>
[+CC linux-wireless]
On Sat, Jun 28, 2014 at 04:35:26PM -0400, Bob Copeland wrote:
> Use get_unaligned_le16 to access llid/plid.
>
> Signed-off-by: Bob Copeland <me@bobcopeland.com>
> ---
> net/mac80211/mesh_plink.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
> index c47194d..421ec06 100644
> --- a/net/mac80211/mesh_plink.c
> +++ b/net/mac80211/mesh_plink.c
> @@ -1004,7 +1004,6 @@ mesh_process_plink_frame(struct ieee80211_sub_if_data *sdata,
> enum ieee80211_self_protected_actioncode ftype;
> u32 changed = 0;
> u8 ie_len = elems->peering_len;
> - __le16 _plid, _llid;
> u16 plid, llid = 0;
>
> if (!elems->peering) {
> @@ -1039,13 +1038,10 @@ mesh_process_plink_frame(struct ieee80211_sub_if_data *sdata,
> /* Note the lines below are correct, the llid in the frame is the plid
> * from the point of view of this host.
> */
> - memcpy(&_plid, PLINK_GET_LLID(elems->peering), sizeof(__le16));
> - plid = le16_to_cpu(_plid);
> + plid = get_unaligned_le16(PLINK_GET_LLID(elems->peering));
> if (ftype == WLAN_SP_MESH_PEERING_CONFIRM ||
> - (ftype == WLAN_SP_MESH_PEERING_CLOSE && ie_len == 8)) {
> - memcpy(&_llid, PLINK_GET_PLID(elems->peering), sizeof(__le16));
> - llid = le16_to_cpu(_llid);
> - }
> + (ftype == WLAN_SP_MESH_PEERING_CLOSE && ie_len == 8))
> + llid = get_unaligned_le16(PLINK_GET_PLID(elems->peering));
>
> /* WARNING: Only for sta pointer, is dropped & re-acquired */
> rcu_read_lock();
> --
> 2.0.0.rc2
>
--
Bob Copeland %% www.bobcopeland.com
next prev parent reply other threads:[~2014-06-28 20:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1403987726-17576-1-git-send-email-me@bobcopeland.com>
2014-06-28 20:54 ` [PATCH 1/2] mac80211: mesh_plink: handle confirm frames with new plid Bob Copeland
2014-07-03 12:36 ` Yeoh Chun-Yeow
2014-07-03 14:28 ` Bob Copeland
2014-07-03 15:10 ` Bob Copeland
2014-07-04 3:12 ` Yeoh Chun-Yeow
2014-07-24 10:58 ` Johannes Berg
[not found] ` <1403987726-17576-2-git-send-email-me@bobcopeland.com>
2014-06-28 20:54 ` Bob Copeland [this message]
2014-07-24 10:59 ` [PATCH 2/2] mac80211: mesh_plink: use get_unaligned_le16 instead of memcpy Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140628205452.GB17825@localhost \
--to=me@bobcopeland.com \
--cc=devel@lists.open80211s.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).