diff options
author | David S. Miller <davem@davemloft.net> | 2020-01-15 22:44:23 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-15 22:44:23 +0100 |
commit | 5a40420e04940c581f736ea3d7588da9b6e99741 (patch) | |
tree | 800b157581be5c804eb46e327e9f0943aa8b2069 /net/batman-adv | |
parent | hv_netvsc: Fix memory leak when removing rndis device (diff) | |
parent | batman-adv: Fix DAT candidate selection on little endian systems (diff) | |
download | linux-5a40420e04940c581f736ea3d7588da9b6e99741.tar.xz linux-5a40420e04940c581f736ea3d7588da9b6e99741.zip |
Merge tag 'batadv-net-for-davem-20200114' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says:
====================
Here is a batman-adv bugfix:
- Fix DAT candidate selection on little endian systems,
by Sven Eckelmann
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/distributed-arp-table.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index b0af3a11d406..ec7bf5a4a9fc 100644 --- a/net/batman-adv/distributed-arp-table.c +++ b/net/batman-adv/distributed-arp-table.c @@ -285,6 +285,7 @@ static u32 batadv_hash_dat(const void *data, u32 size) u32 hash = 0; const struct batadv_dat_entry *dat = data; const unsigned char *key; + __be16 vid; u32 i; key = (const unsigned char *)&dat->ip; @@ -294,7 +295,8 @@ static u32 batadv_hash_dat(const void *data, u32 size) hash ^= (hash >> 6); } - key = (const unsigned char *)&dat->vid; + vid = htons(dat->vid); + key = (__force const unsigned char *)&vid; for (i = 0; i < sizeof(dat->vid); i++) { hash += key[i]; hash += (hash << 10); |