svn commit: r261835 - head/sys/netinet6

Andrey V. Elsukov ae at FreeBSD.org
Thu Feb 13 14:10:45 UTC 2014


Author: ae
Date: Thu Feb 13 14:10:44 2014
New Revision: 261835
URL: http://svnweb.freebsd.org/changeset/base/261835

Log:
  Drop packets to multicast address whose scop field contains the
  reserved value 0.
  
  MFC after:	1 week
  Sponsored by:	Yandex LLC

Modified:
  head/sys/netinet6/ip6_input.c

Modified: head/sys/netinet6/ip6_input.c
==============================================================================
--- head/sys/netinet6/ip6_input.c	Thu Feb 13 13:11:34 2014	(r261834)
+++ head/sys/netinet6/ip6_input.c	Thu Feb 13 14:10:44 2014	(r261835)
@@ -547,7 +547,18 @@ ip6_input(struct mbuf *m)
 		in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr);
 		goto bad;
 	}
-
+	if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) &&
+	    IPV6_ADDR_MC_SCOPE(&ip6->ip6_dst) == 0) {
+		/*
+		 * RFC4291 2.7:
+		 * Nodes must not originate a packet to a multicast address
+		 * whose scop field contains the reserved value 0; if such
+		 * a packet is received, it must be silently dropped.
+		 */
+		IP6STAT_INC(ip6s_badscope);
+		in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr);
+		goto bad;
+	}
 #ifdef ALTQ
 	if (altq_input != NULL && (*altq_input)(m, AF_INET6) == 0) {
 		/* packet is dropped by traffic conditioner */


More information about the svn-src-all mailing list