mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Synchronize with sys/i386/isa/if_ed.c revision 1.112 and
sys/i386/isa/if_fe.c revision 1.23 (new if_multiaddrs list).
This commit is contained in:
parent
9ca816cb59
commit
8df4619996
2 changed files with 24 additions and 56 deletions
|
|
@ -3432,21 +3432,11 @@ ed_ioctl(ifp, command, data)
|
|||
case SIOCADDMULTI:
|
||||
case SIOCDELMULTI:
|
||||
/*
|
||||
* Update out multicast list.
|
||||
* Multicast list has changed; set the hardware filter
|
||||
* accordingly.
|
||||
*/
|
||||
error = (command == SIOCADDMULTI) ?
|
||||
ether_addmulti(ifr, &sc->arpcom) :
|
||||
ether_delmulti(ifr, &sc->arpcom);
|
||||
|
||||
if (error == ENETRESET) {
|
||||
|
||||
/*
|
||||
* Multicast list has changed; set the hardware filter
|
||||
* accordingly.
|
||||
*/
|
||||
ed_setrcr(sc);
|
||||
error = 0;
|
||||
}
|
||||
ed_setrcr(sc);
|
||||
error = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -4242,22 +4232,17 @@ ds_getmcaf(sc, mcaf)
|
|||
{
|
||||
register u_int index;
|
||||
register u_char *af = (u_char *) mcaf;
|
||||
register struct ether_multi *enm;
|
||||
register struct ether_multistep step;
|
||||
struct ifmultiaddr *ifma;
|
||||
|
||||
mcaf[0] = 0;
|
||||
mcaf[1] = 0;
|
||||
|
||||
ETHER_FIRST_MULTI(step, &sc->arpcom, enm);
|
||||
while (enm != NULL) {
|
||||
if (bcmp(enm->enm_addrlo, enm->enm_addrhi, 6) != 0) {
|
||||
mcaf[0] = 0xffffffff;
|
||||
mcaf[1] = 0xffffffff;
|
||||
return;
|
||||
}
|
||||
index = ds_crc(enm->enm_addrlo) >> 26;
|
||||
for (ifma = sc->arpcom.ac_if.if_multiaddrs.lh_first; ifma;
|
||||
ifma = ifma->ifma_link.le_next) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
index = ds_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr))
|
||||
>> 26;
|
||||
af[index >> 3] |= 1 << (index & 7);
|
||||
|
||||
ETHER_NEXT_MULTI(step, enm);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2893,27 +2893,13 @@ fe_ioctl ( struct ifnet * ifp, int command, caddr_t data )
|
|||
#ifdef SIOCADDMULTI
|
||||
case SIOCADDMULTI:
|
||||
case SIOCDELMULTI:
|
||||
{
|
||||
/*
|
||||
* Update out multicast list.
|
||||
*/
|
||||
struct ifreq * ifr = ( struct ifreq * )data;
|
||||
|
||||
error = ( command == SIOCADDMULTI )
|
||||
? ether_addmulti( ifr, &sc->arpcom )
|
||||
: ether_delmulti( ifr, &sc->arpcom );
|
||||
|
||||
if ( error == ENETRESET ) {
|
||||
/*
|
||||
* Multicast list has changed; set the hardware filter
|
||||
* accordingly.
|
||||
*/
|
||||
fe_setmode( sc );
|
||||
error = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* Multicast list has changed; set the hardware filter
|
||||
* accordingly.
|
||||
*/
|
||||
fe_setmode( sc );
|
||||
error = 0;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef SIOCSIFMTU
|
||||
|
|
@ -3225,23 +3211,20 @@ fe_mcaf ( struct fe_softc *sc )
|
|||
{
|
||||
int index;
|
||||
struct fe_filter filter;
|
||||
struct ether_multi *enm;
|
||||
struct ether_multistep step;
|
||||
struct ifmultiaddr *ifma;
|
||||
|
||||
filter = fe_filter_nothing;
|
||||
ETHER_FIRST_MULTI(step, &sc->arpcom, enm);
|
||||
while ( enm != NULL) {
|
||||
if ( bcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN) ) {
|
||||
return ( fe_filter_all );
|
||||
}
|
||||
index = fe_hash( enm->enm_addrlo );
|
||||
for (ifma = sc->arpcom.ac_if.if_multiaddrs.lh_first; ifma;
|
||||
ifma = ifma->ifma_link.le_next) {
|
||||
if (ifma->ifma_addr->sa_family != AF_LINK)
|
||||
continue;
|
||||
index = fe_hash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
|
||||
#if FE_DEBUG >= 4
|
||||
log( LOG_INFO, "fe%d: hash(%6D) == %d\n",
|
||||
sc->sc_unit, enm->enm_addrlo , ":", index );
|
||||
#endif
|
||||
|
||||
filter.data[index >> 3] |= 1 << (index & 7);
|
||||
ETHER_NEXT_MULTI(step, enm);
|
||||
}
|
||||
return ( filter );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue