Convert to if_foreach_llmaddr() KPI.
This commit is contained in:
parent
cb9389f457
commit
5e9ef24921
@ -649,6 +649,20 @@ re_miibus_statchg(device_t dev)
|
||||
*/
|
||||
}
|
||||
|
||||
static u_int
|
||||
re_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt)
|
||||
{
|
||||
uint32_t h, *hashes = arg;
|
||||
|
||||
h = ether_crc32_be(LLADDR(sdl), ETHER_ADDR_LEN) >> 26;
|
||||
if (h < 32)
|
||||
hashes[0] |= (1 << h);
|
||||
else
|
||||
hashes[1] |= (1 << (h - 32));
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the RX configuration and 64-bit multicast hash filter.
|
||||
*/
|
||||
@ -656,9 +670,8 @@ static void
|
||||
re_set_rxmode(struct rl_softc *sc)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
struct ifmultiaddr *ifma;
|
||||
uint32_t hashes[2] = { 0, 0 };
|
||||
uint32_t h, rxfilt;
|
||||
uint32_t h, hashes[2] = { 0, 0 };
|
||||
uint32_t rxfilt;
|
||||
|
||||
RL_LOCK_ASSERT(sc);
|
||||
|
||||
@ -683,18 +696,7 @@ re_set_rxmode(struct rl_softc *sc)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if_maddr_rlock(ifp);
|
||||
CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
h = ether_crc32_be(LLADDR((struct sockaddr_dl *)
|
||||
ifma->ifma_addr), ETHER_ADDR_LEN) >> 26;
|
||||
if (h < 32)
|
||||
hashes[0] |= (1 << h);
|
||||
else
|
||||
hashes[1] |= (1 << (h - 32));
|
||||
}
|
||||
if_maddr_runlock(ifp);
|
||||
if_foreach_llmaddr(ifp, re_hash_maddr, hashes);
|
||||
|
||||
if (hashes[0] != 0 || hashes[1] != 0) {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user