2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

lib/packet.h: add hash_mac()

Add hash_mac() and apply it when appropriate.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Andy Zhou
2014-03-27 20:22:37 -07:00
parent 965607c850
commit 7e36ac42e3
5 changed files with 20 additions and 5 deletions

View File

@@ -45,9 +45,7 @@ static uint32_t
mac_table_hash(const struct mac_learning *ml, const uint8_t mac[ETH_ADDR_LEN],
uint16_t vlan)
{
unsigned int mac1 = get_unaligned_u32(ALIGNED_CAST(uint32_t *, mac));
unsigned int mac2 = get_unaligned_u16(ALIGNED_CAST(uint16_t *, mac + 4));
return hash_3words(mac1, mac2 | (vlan << 16), ml->secret);
return hash_mac(mac, vlan, ml->secret);
}
static struct mac_entry *