diff mbox series

Subject: [PATCH net-next] bonding: Fix hashing byte order

Message ID CAK0T-BKRWOLR8h7uaFV6pYfkYcG8qb0CrzLXSvcpNWafWcA_dg@mail.gmail.com
State Changes Requested
Delegated to: David Miller
Headers show
Series Subject: [PATCH net-next] bonding: Fix hashing byte order | expand

Commit Message

Craig Robson Feb. 23, 2020, 4:46 p.m. UTC
Change to use host order bytes when hashing IP address.
---
 drivers/net/bonding/bond_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Miller Feb. 24, 2020, 4:44 a.m. UTC | #1
From: Craig Robson <craig@zhatt.com>
Date: Sun, 23 Feb 2020 08:46:56 -0800

> Change to use host order bytes when hashing IP address.

It's a hash, it doesn't matter really.

Also your submission was missing a proper Signed-off-by: tag.
diff mbox series

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index fef599eb822b..6f9a0758c54f 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3274,8 +3274,8 @@  u32 bond_xmit_hash(struct bonding *bond, struct
sk_buff *skb)
                hash = bond_eth_hash(skb);
        else
                hash = (__force u32)flow.ports.ports;
-       hash ^= (__force u32)flow_get_u32_dst(&flow) ^
-               (__force u32)flow_get_u32_src(&flow);
+       hash ^= ntohl((__force u32)flow_get_u32_dst(&flow)) ^
+               ntohl((__force u32)flow_get_u32_src(&flow));
        hash ^= (hash >> 16);
        hash ^= (hash >> 8);