summaryrefslogtreecommitdiffstats
path: root/sys/dev/fe
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1997-01-13 21:26:53 +0000
committerwollman <wollman@FreeBSD.org>1997-01-13 21:26:53 +0000
commit19e2ac904f46e8d37d7cd3d2b1186258b4e8f73b (patch)
tree910b1426d4c193f9ebe781e273cdb61d4b1ee1fd /sys/dev/fe
parent52ec48faa0c0c800965bfbe06fa3f8869f922d41 (diff)
downloadFreeBSD-src-19e2ac904f46e8d37d7cd3d2b1186258b4e8f73b.zip
FreeBSD-src-19e2ac904f46e8d37d7cd3d2b1186258b4e8f73b.tar.gz
Use the new if_multiaddrs list for multicast addresses rather than the
previous hackery involving struct in_ifaddr and arpcom. Get rid of the abominable multi_kludge. Update all network interfaces to use the new machanism. Distressingly few Ethernet drivers program the multicast filter properly (assuming the hardware has one, which it usually does).
Diffstat (limited to 'sys/dev/fe')
-rw-r--r--sys/dev/fe/if_fe.c45
1 files changed, 14 insertions, 31 deletions
diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c
index 9c2cf8e..c714734 100644
--- a/sys/dev/fe/if_fe.c
+++ b/sys/dev/fe/if_fe.c
@@ -21,7 +21,7 @@
*/
/*
- * $Id: if_fe.c,v 1.21 1996/11/15 16:15:56 wollman Exp $
+ * $Id: if_fe.c,v 1.22 1996/12/13 21:28:22 wollman Exp $
*
* Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards.
* To be used with FreeBSD 2.x
@@ -2623,27 +2623,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
@@ -2955,23 +2941,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 );
}
OpenPOWER on IntegriCloud