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

login
register
mail settings
Submitter stephen hemminger
Date Oct. 10, 2012, 6:35 a.m.
Message ID <20121010063623.471596387@vyatta.com>
Download mbox | patch
Permalink /patch/190560/
State Accepted
Delegated to: David Miller
Headers show

Comments

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

--- 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);
 }