aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/can/isotp.c
diff options
context:
space:
mode:
authorsuresh kumar <suresh2514@gmail.com>2022-04-16 16:44:10 +0530
committerDavid S. Miller <davem@davemloft.net>2022-04-17 13:34:01 +0100
commit49aefd131739df552f83c566d0665744c30b1d70 (patch)
treee5311b9a57f1d0de6bd0e8933d27c24a6bd9ed56 /net/can/isotp.c
parentnet: lan966x: Make sure to release ptp interrupt (diff)
downloadwireguard-linux-49aefd131739df552f83c566d0665744c30b1d70.tar.xz
wireguard-linux-49aefd131739df552f83c566d0665744c30b1d70.zip
bonding: do not discard lowest hash bit for non layer3+4 hashing
Commit b5f862180d70 was introduced to discard lowest hash bit for layer3+4 hashing but it also removes last bit from non layer3+4 hashing Below script shows layer2+3 hashing will result in same slave to be used with above commit. $ cat hash.py #/usr/bin/python3.6 h_dests=[0xa0, 0xa1] h_source=0xe3 hproto=0x8 saddr=0x1e7aa8c0 daddr=0x17aa8c0 for h_dest in h_dests: hash = (h_dest ^ h_source ^ hproto ^ saddr ^ daddr) hash ^= hash >> 16 hash ^= hash >> 8 print(hash) print("with last bit removed") for h_dest in h_dests: hash = (h_dest ^ h_source ^ hproto ^ saddr ^ daddr) hash ^= hash >> 16 hash ^= hash >> 8 hash = hash >> 1 print(hash) Output: $ python3.6 hash.py 522133332 522133333 <-------------- will result in both slaves being used with last bit removed 261066666 261066666 <-------------- only single slave used Signed-off-by: suresh kumar <suresh2514@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/can/isotp.c')
0 files changed, 0 insertions, 0 deletions