From 905db383404075f39d72f86232d20d308892e549 Mon Sep 17 00:00:00 2001 From: is Date: Mon, 2 Sep 1996 17:28:22 +0000 Subject: [PATCH] Add IP multicast support as per RFC 1122 section 3.3.7 to ARCnet. "The mapping of IP Class D addresses to local addresses is currently specified for the following types of networks: [...] o Any network that supports broadcast but not multicast, addressing: all IP Class D addresses map to the local broadcast address." --- sys/arch/amiga/dev/if_bah.c | 12 ++++++++++-- sys/net/if_arcsubr.c | 11 +++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/sys/arch/amiga/dev/if_bah.c b/sys/arch/amiga/dev/if_bah.c index c8b276ecb928..2a39b4959903 100644 --- a/sys/arch/amiga/dev/if_bah.c +++ b/sys/arch/amiga/dev/if_bah.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bah.c,v 1.18 1996/05/07 00:46:39 thorpej Exp $ */ +/* $NetBSD: if_bah.c,v 1.19 1996/09/02 17:28:22 is Exp $ */ /* * Copyright (c) 1994, 1995 Ignatios Souvatzis @@ -1146,11 +1146,13 @@ bah_ioctl(ifp, command, data) { struct bah_softc *sc; register struct ifaddr *ifa; + struct ifreq *ifr; int s, error; error = 0; sc = ifp->if_softc; ifa = (struct ifaddr *)data; + ifr = (struct ifreq *)data; s = splnet(); #if defined(BAH_DEBUG) && (BAH_DEBUG > 2) @@ -1191,7 +1193,13 @@ bah_ioctl(ifp, command, data) } break; - /* Multicast not supported */ + case SIOCSIFMULTI: + case SIOCDIFMULTI: + if (ifr->ifr_addr.sa_family == AF_INET) + error = 0; + else + error = EAFNOSUPPORT; + break; default: error = EINVAL; diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c index 0b77b6ef8c0d..a077ac7cedf2 100644 --- a/sys/net/if_arcsubr.c +++ b/sys/net/if_arcsubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_arcsubr.c,v 1.8 1996/05/07 02:40:29 thorpej Exp $ */ +/* $NetBSD: if_arcsubr.c,v 1.9 1996/09/02 17:28:25 is Exp $ */ /* * Copyright (c) 1994, 1995 Ignatios Souvatzis @@ -143,13 +143,14 @@ arc_output(ifp, m0, dst, rt0) /* * For now, use the simple IP addr -> ARCnet addr mapping */ - if (m->m_flags & M_BCAST) + if (m->m_flags & (M_BCAST|M_MCAST)) adst = arcbroadcastaddr; /* ARCnet broadcast address */ else adst = ntohl(SIN(dst)->sin_addr.s_addr) & 0xFF; /* If broadcasting on a simplex interface, loopback a copy */ - if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX)) + if ((m->m_flags & (M_BCAST|M_MCAST)) && + (ifp->if_flags & IFF_SIMPLEX)) mcopy = m_copy(m, 0, (int)M_COPYALL); if (ifp->if_flags & IFF_LINK0) { atype = ARCTYPE_IP; @@ -486,7 +487,7 @@ arc_input(ifp, m) ifp->if_ibytes += m->m_pkthdr.len; if (arcbroadcastaddr == ah->arc_dhost) { - m->m_flags |= M_BCAST; + m->m_flags |= M_BCAST|M_MCAST; ifp->if_imcasts++; } @@ -550,6 +551,8 @@ arc_ifattach(ifp) ifp->if_type = IFT_ARCNET; ifp->if_addrlen = 1; ifp->if_hdrlen = ARC_HDRLEN; + if (ifp->if_flags & IFF_BROADCAST) + ifp->if_flags |= IFF_MULTICAST|IFF_ALLMULTI; if (ifp->if_flags & IFF_LINK0 && arc_phdsmtu > 60480) log(LOG_ERR, "%s: arc_phdsmtu is %d, but must not exceed 60480",