From patchwork Wed Oct 10 06:35:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCHv2,2/8] vxlan: fix byte order in hash function Date: Tue, 09 Oct 2012 20:35:47 -0000 From: stephen hemminger X-Patchwork-Id: 190560 Message-Id: <20121010063623.471596387@vyatta.com> To: davem@davemloft.net Cc: netdev@vger.kernel.org Shift was wrong direction causing packets to hash based on other parts of the ethernet header, not the address. Signed-off-by: Stephen Hemminger --- 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 --- 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); }