[PATCHv2,2/8] vxlan: fix byte order in hash function

Submitted by stephen hemminger on Oct. 10, 2012, 6:35 a.m.

Details

Message ID 20121010063623.471596387@vyatta.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

stephen hemminger Oct. 10, 2012, 6:35 a.m.
Shift was wrong direction causing packets to hash based on
other parts of the ethernet header, not the address.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>




--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch hide | download patch | download mbox

--- a/drivers/net/vxlan.c	2012-10-09 18:08:31.722465071 -0700
+++ b/drivers/net/vxlan.c	2012-10-09 18:08:32.630456072 -0700
@@ -228,9 +228,9 @@  static u32 eth_hash(const unsigned char
 
 	/* only want 6 bytes */
 #ifdef __BIG_ENDIAN
-	value <<= 16;
-#else
 	value >>= 16;
+#else
+	value <<= 16;
 #endif
 	return hash_64(value, FDB_HASH_BITS);
 }