Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jan 2015 12:56:51 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276886 - in head/sys: net netinet netinet6
Message-ID:  <201501091256.t09Cup6f048763@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: melifaro
Date: Fri Jan  9 12:56:51 2015
New Revision: 276886
URL: https://svnweb.freebsd.org/changeset/base/276886

Log:
  * 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

Modified:
  head/sys/net/if_arcsubr.c
  head/sys/netinet/if_ether.c
  head/sys/netinet6/nd6.c

Modified: head/sys/net/if_arcsubr.c
==============================================================================
--- head/sys/net/if_arcsubr.c	Fri Jan  9 12:26:08 2015	(r276885)
+++ head/sys/net/if_arcsubr.c	Fri Jan  9 12:56:51 2015	(r276886)
@@ -167,7 +167,10 @@ arc_output(struct ifnet *ifp, struct mbu
 #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;

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Fri Jan  9 12:26:08 2015	(r276885)
+++ head/sys/netinet/if_ether.c	Fri Jan  9 12:56:51 2015	(r276886)
@@ -317,7 +317,7 @@ arpresolve(struct ifnet *ifp, int is_gw,
 			    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);

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c	Fri Jan  9 12:26:08 2015	(r276885)
+++ head/sys/netinet6/nd6.c	Fri Jan  9 12:56:51 2015	(r276886)
@@ -2213,8 +2213,6 @@ nd6_storelladdr(struct ifnet *ifp, struc
 		*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, struc
 			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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501091256.t09Cup6f048763>