diff options
author | Ethan Jackson <ethan@nicira.com> | 2012-06-06 17:37:46 -0700 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2012-06-06 17:37:46 -0700 |
commit | 3b842fc2f0f8367d7d1350a80f7c29edca0925b5 (patch) | |
tree | 83964ebe8d8093b19c4eff056b35c56f3bc44e20 /lib/packets.h | |
parent | aecfb4af7e87a78dfec44db1fa82c4463a7f8309 (diff) |
packets: Fix eth_addr_equal_except().
It turns out that eth_addr_equal_except() computed the exact
opposite of what it purported to. It returned true if the two
arguments where *not* equal. This is extremely confusing, so this
patch changes it.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib/packets.h')
-rw-r--r-- | lib/packets.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/packets.h b/lib/packets.h index 00c2b75b..afe4b6b3 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -84,12 +84,12 @@ static inline bool eth_addr_equal_except(const uint8_t a[ETH_ADDR_LEN], const uint8_t b[ETH_ADDR_LEN], const uint8_t mask[ETH_ADDR_LEN]) { - return (((a[0] ^ b[0]) & mask[0]) - || ((a[1] ^ b[1]) & mask[1]) - || ((a[2] ^ b[2]) & mask[2]) - || ((a[3] ^ b[3]) & mask[3]) - || ((a[4] ^ b[4]) & mask[4]) - || ((a[5] ^ b[5]) & mask[5])); + return !(((a[0] ^ b[0]) & mask[0]) + || ((a[1] ^ b[1]) & mask[1]) + || ((a[2] ^ b[2]) & mask[2]) + || ((a[3] ^ b[3]) & mask[3]) + || ((a[4] ^ b[4]) & mask[4]) + || ((a[5] ^ b[5]) & mask[5])); } static inline uint64_t eth_addr_to_uint64(const uint8_t ea[ETH_ADDR_LEN]) { |