summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/if_le.c
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/i386/isa/if_le.c
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/i386/isa/if_le.c')
-rw-r--r--sys/i386/isa/if_le.c45
1 files changed, 13 insertions, 32 deletions
diff --git a/sys/i386/isa/if_le.c b/sys/i386/isa/if_le.c
index ccad397..91946d1 100644
--- a/sys/i386/isa/if_le.c
+++ b/sys/i386/isa/if_le.c
@@ -21,7 +21,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_le.c,v 1.33 1996/06/18 01:22:23 bde Exp $
+ * $Id: if_le.c,v 1.34 1996/09/06 23:07:40 phk Exp $
*/
/*
@@ -590,22 +590,13 @@ le_ioctl(
}
case SIOCADDMULTI:
- case SIOCDELMULTI: {
+ case SIOCDELMULTI:
/*
* Update multicast listeners
*/
- if (cmd == SIOCADDMULTI)
- error = ether_addmulti((struct ifreq *)data, &sc->le_ac);
- else
- error = ether_delmulti((struct ifreq *)data, &sc->le_ac);
-
- if (error == ENETRESET) {
- /* reset multicast filtering */
(*sc->if_init)(ifp->if_unit);
error = 0;
- }
- break;
- }
+ break;
default: {
error = EINVAL;
@@ -682,11 +673,7 @@ static void
le_multi_filter(
le_softc_t *sc)
{
- struct ether_multistep step;
- struct ether_multi *enm;
-#ifdef ISO
- extern char all_es_snpa[];
-#endif
+ struct ifmultiaddr *ifma;
MEMSET(sc->le_mctbl, 0, (sc->le_mcmask + 1) / 8);
@@ -699,23 +686,17 @@ le_multi_filter(
le_multi_op(sc, etherbroadcastaddr, TRUE);
sc->le_flags |= LE_BRDCSTONLY|IFF_MULTICAST;
/* } */
-#ifdef ISO
- le_multi_op(sc, all_es_snpa, TRUE);
-#endif
- ETHER_FIRST_MULTI(step, &sc->le_ac, enm);
- if (enm != NULL)
- sc->le_flags |= IFF_MULTICAST;
- while (enm != NULL) {
- if (MEMCMP(enm->enm_addrlo, enm->enm_addrhi, 6) != 0) {
- sc->le_flags |= IFF_ALLMULTI;
- return;
- }
- le_multi_op(sc, enm->enm_addrlo, TRUE);
- ETHER_NEXT_MULTI(step, enm);
- sc->le_flags &= ~LE_BRDCSTONLY;
+ sc->le_flags |= IFF_MULTICAST;
+
+ for (ifma = sc->le_ac.ac_if.if_multiaddrs.lh_first; ifma;
+ ifma = ifma->ifma_link.le_next) {
+ if (ifma->ifma_addr->sa_family != AF_LINK)
+ continue;
+
+ le_multi_op(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr), 1);
+ sc->le_flags &= ~LE_BRDCSTONLY;
}
- sc->le_flags &= ~IFF_ALLMULTI;
}
static void
OpenPOWER on IntegriCloud