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."
This commit is contained in:
parent
42f3427158
commit
905db38340
|
@ -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;
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue