summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Monjalon <thomas.monjalon@6wind.com>2014-08-01 17:53:51 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-08-01 17:56:54 +0200
commit030df0102ce762360df343a63bbcfbbbc30872b1 (patch)
tree8e80c374a2d1af43e7670cfab5064ef29af396f6
parent06c1bfd94ae4892612bd07c05087faa29ae4ed05 (diff)
downloaddpdk-030df0102ce762360.zip
dpdk-030df0102ce762360.tar.gz
dpdk-030df0102ce762360.tar.xz
ether: fix local address check
cppcheck reports show that is_local_admin_ether_addr() was broken: Expression '(X & 0x2) == 0x1' is always false Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
-rw-r--r--lib/librte_ether/rte_ether.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/librte_ether/rte_ether.h b/lib/librte_ether/rte_ether.h
index cd0c7c4..2e08f23 100644
--- a/lib/librte_ether/rte_ether.h
+++ b/lib/librte_ether/rte_ether.h
@@ -205,7 +205,7 @@ static inline int is_universal_ether_addr(const struct ether_addr *ea)
*/
static inline int is_local_admin_ether_addr(const struct ether_addr *ea)
{
- return ((ea->addr_bytes[0] & ETHER_LOCAL_ADMIN_ADDR) == 1);
+ return ((ea->addr_bytes[0] & ETHER_LOCAL_ADMIN_ADDR) != 0);
}
/**