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.
bool
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 &