X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fmac-learning.c;h=7dcce4154fe06306b71580260d782d17c6b0c67c;hb=a6fcf462476db3385027d3bfcc1d2dc8386e6f2a;hp=01a34f583571550a387c69216a88cf30e3ea4a75;hpb=37bec3d330ed7f72b6a867728c538b49e5727dc7;p=sliver-openvswitch.git diff --git a/lib/mac-learning.c b/lib/mac-learning.c index 01a34f583..7dcce4154 100644 --- a/lib/mac-learning.c +++ b/lib/mac-learning.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -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 * @@ -141,7 +139,6 @@ mac_learning_unref(struct mac_learning *ml) bitmap_free(ml->flood_vlans); ovs_rwlock_destroy(&ml->rwlock); - ovs_refcount_destroy(&ml->ref_cnt); free(ml); } }