base: fix operator== for comparing EthAddr objects

this operator uses memcmp() to detect if two EthAddr object have the same
address, however memcmp() will return 0 if all bytes are equal. operator==
returns the return value of memcmp() to indicate whether or not two
address are equal. this is incorrect as it will always give the opposite of
the intended behavior. this patch fixes that problem.
This commit is contained in:
Anthony Gutierrez 2014-07-09 09:28:15 -04:00
parent 3956ec0a89
commit 59c8c454eb

View file

@ -124,7 +124,7 @@ EthAddr::string() const
bool bool
operator==(const EthAddr &left, const EthAddr &right) operator==(const EthAddr &left, const EthAddr &right)
{ {
return memcmp(left.bytes(), right.bytes(), ETH_ADDR_LEN); return !memcmp(left.bytes(), right.bytes(), ETH_ADDR_LEN);
} }
ostream & ostream &