* Deal with ARCNET L2 multicast mapping for IPv6 the same way as in IPv4:
handle it in arc_output() instead of nd6_storelladdr(). * Remove IFT_ARCNET check from arpresolve() since arc_output() does not use arpresolve() to handle broadcast/multicast. This check was there since r84931. It looks like it was not used since r89099 (initial import of Arcnet support where multicast is handled separately). * Remove IFT_IEEE1394 case from nd6_storelladdr() since firewire_output() calles nd6_storelladdr() for unicast addresses only. * Remove IFT_ARCNET case from nd6_storelladdr() since arc_output() now handles multicast by itself. As a result, we have the following pattern: all non-ethernet-style media have their own multicast map handling inside their appropriate routines. On the other hand, arpresolve() (and nd6_storelladdr()) which meant to be 'generic' ones de-facto handles ethernet-only multicast maps. MFC after: 3 weeks
This commit is contained in:
parent
40c1416a62
commit
d63e657c04
@ -167,7 +167,10 @@ arc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
#endif
|
||||
#ifdef INET6
|
||||
case AF_INET6:
|
||||
error = nd6_storelladdr(ifp, m, dst, (u_char *)&adst, NULL);
|
||||
if ((m->m_flags & M_MCAST) != NULL)
|
||||
adst = arcbroadcastaddr; /* ARCnet broadcast address */
|
||||
else
|
||||
error = nd6_storelladdr(ifp, m, dst, (u_char *)&adst, NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
atype = ARCTYPE_INET6;
|
||||
|
@ -317,7 +317,7 @@ arpresolve(struct ifnet *ifp, int is_gw, struct mbuf *m,
|
||||
ifp->if_broadcastaddr, ifp->if_addrlen);
|
||||
return (0);
|
||||
}
|
||||
if (m->m_flags & M_MCAST && ifp->if_type != IFT_ARCNET) {
|
||||
if (m->m_flags & M_MCAST) {
|
||||
/* multicast */
|
||||
ETHER_MAP_IP_MULTICAST(&SIN(dst)->sin_addr, desten);
|
||||
return (0);
|
||||
|
@ -2213,8 +2213,6 @@ nd6_storelladdr(struct ifnet *ifp, struct mbuf *m,
|
||||
*pflags = 0;
|
||||
IF_AFDATA_UNLOCK_ASSERT(ifp);
|
||||
if (m != NULL && m->m_flags & M_MCAST) {
|
||||
int i;
|
||||
|
||||
switch (ifp->if_type) {
|
||||
case IFT_ETHER:
|
||||
case IFT_FDDI:
|
||||
@ -2229,17 +2227,6 @@ nd6_storelladdr(struct ifnet *ifp, struct mbuf *m,
|
||||
ETHER_MAP_IPV6_MULTICAST(&SIN6(dst)->sin6_addr,
|
||||
desten);
|
||||
return (0);
|
||||
case IFT_IEEE1394:
|
||||
/*
|
||||
* netbsd can use if_broadcastaddr, but we don't do so
|
||||
* to reduce # of ifdef.
|
||||
*/
|
||||
for (i = 0; i < ifp->if_addrlen; i++)
|
||||
desten[i] = ~0;
|
||||
return (0);
|
||||
case IFT_ARCNET:
|
||||
*desten = 0;
|
||||
return (0);
|
||||
default:
|
||||
m_freem(m);
|
||||
return (EAFNOSUPPORT);
|
||||
|
Loading…
Reference in New Issue
Block a user