{
return !(ea[0] | ea[1] | ea[2] | ea[3] | ea[4] | ea[5]);
}
+static inline int eth_addr_compare_3way(const uint8_t a[ETH_ADDR_LEN],
+ const uint8_t b[ETH_ADDR_LEN])
+{
+ return memcmp(a, b, ETH_ADDR_LEN);
+}
static inline bool eth_addr_equals(const uint8_t a[ETH_ADDR_LEN],
const uint8_t b[ETH_ADDR_LEN])
{
- return !memcmp(a, b, ETH_ADDR_LEN);
+ return !eth_addr_compare_3way(a, b);
}
static inline uint64_t eth_addr_to_uint64(const uint8_t ea[ETH_ADDR_LEN])
{
static int
compare_macs(const void *a, const void *b)
{
- return memcmp(a, b, ETH_ADDR_LEN);
+ return eth_addr_compare_3way(a, b);
}
void
!eth_addr_is_local(iface_ea) &&
!eth_addr_is_reserved(iface_ea) &&
!eth_addr_is_zero(iface_ea) &&
- memcmp(iface_ea, ea, ETH_ADDR_LEN) < 0)
+ eth_addr_compare_3way(iface_ea, ea) < 0)
{
memcpy(ea, iface_ea, ETH_ADDR_LEN);
*hw_addr_iface = iface;