Skip to content

Commit

Permalink
Merge tag 'batadv-net-for-davem-20200114' of git://git.open-mesh.org/…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
davem330 committed Jan 15, 2020
2 parents 536dc5d + 4cc4a17 commit 5a40420
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/batman-adv/distributed-arp-table.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 5a40420

Please sign in to comment.