diff options
author | Felix Fietkau <nbd@nbd.name> | 2019-03-13 18:54:27 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2019-03-29 11:18:48 +0100 |
commit | 40586e3fc400c00c11151804dcdc93f8c831c808 (patch) | |
tree | 5710a4a42eb62ccff3aed29e2d18a2e4971ca2c7 /net/mac80211 | |
parent | b49c15e1211cc962cb73bbaaa5175ae068144893 (diff) | |
download | linux-40586e3fc400c00c11151804dcdc93f8c831c808.tar.bz2 |
mac80211: fix unaligned access in mesh table hash function
The pointer to the last four bytes of the address is not guaranteed to be
aligned, so we need to use __get_unaligned_cpu32 here
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/mesh_pathtbl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 95eb5064fa91..b76a2aefa9ec 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -23,7 +23,7 @@ static void mesh_path_free_rcu(struct mesh_table *tbl, struct mesh_path *mpath); static u32 mesh_table_hash(const void *addr, u32 len, u32 seed) { /* Use last four bytes of hw addr as hash index */ - return jhash_1word(*(u32 *)(addr+2), seed); + return jhash_1word(__get_unaligned_cpu32((u8 *)addr + 2), seed); } static const struct rhashtable_params mesh_rht_params = { |