Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 2014 21:02:00 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r262256 - stable/10/sys/netinet6
Message-ID:  <201402202102.s1KL20r0053381@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Thu Feb 20 21:01:59 2014
New Revision: 262256
URL: http://svnweb.freebsd.org/changeset/base/262256

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

Modified:
  stable/10/sys/netinet6/ip6_input.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet6/ip6_input.c
==============================================================================
--- stable/10/sys/netinet6/ip6_input.c	Thu Feb 20 20:53:29 2014	(r262255)
+++ stable/10/sys/netinet6/ip6_input.c	Thu Feb 20 21:01:59 2014	(r262256)
@@ -571,7 +571,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 */



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