net: explicit cast of multicast bit clearing
GCC 8.1 warned:
rte_ether.h:213:13:
warning: conversion from 'int' to 'uint8_t'
{aka 'unsigned char'} may change value [-Wconversion]
addr[0] &= ~ETHER_GROUP_ADDR;
Fixes: 7ef0072910
("ethdev: random MAC address")
Cc: stable@dpdk.org
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This commit is contained in:
parent
c779ebdca0
commit
beb4076567
@ -210,7 +210,7 @@ static inline void eth_random_addr(uint8_t *addr)
|
||||
uint8_t *p = (uint8_t *)&rand;
|
||||
|
||||
rte_memcpy(addr, p, ETHER_ADDR_LEN);
|
||||
addr[0] &= ~ETHER_GROUP_ADDR; /* clear multicast bit */
|
||||
addr[0] &= (uint8_t)~ETHER_GROUP_ADDR; /* clear multicast bit */
|
||||
addr[0] |= ETHER_LOCAL_ADMIN_ADDR; /* set local assignment bit */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user