From 030df0102ce762360df343a63bbcfbbbc30872b1 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Fri, 1 Aug 2014 17:53:51 +0200 Subject: [PATCH] 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 Signed-off-by: Thomas Monjalon --- lib/librte_ether/rte_ether.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_ether.h b/lib/librte_ether/rte_ether.h index cd0c7c413d..2e08f233ed 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); } /** -- 2.20.1